diff -uNr -x *.sh -x Makefile* -x *.Po -x *.nsi -x *.exe xorp-1.2/fea/rawsock.cc xorp-1.2-ok/fea/rawsock.cc --- xorp-1.2/fea/rawsock.cc Thu Dec 22 04:18:23 2005 +++ xorp-1.2-ok/fea/rawsock.cc Tue Mar 14 04:29:40 2006 @@ -699,13 +699,13 @@ #ifdef HOST_OS_WINDOWS // - // Winsock requires that raw sockets be bound to the interface - // they're being used to receive or send on. -bms + // Winsock requires that raw sockets be bound to an interface, + // or INADDR_ANY, before being joined to a multicast group. // struct sockaddr_in sin; memset(&sin, 0, sizeof(sin)); sin.sin_family = AF_INET; - sin.sin_addr = in_addr; + sin.sin_addr.s_addr = INADDR_ANY; if (SOCKET_ERROR == bind(_proto_socket, (sockaddr *)&sin, sizeof(sockaddr_in))) { diff -uNr -x *.sh -x Makefile* -x *.Po -x *.nsi -x *.exe xorp-1.2/libxorp/ether_compat.c xorp-1.2-ok/libxorp/ether_compat.c --- xorp-1.2/libxorp/ether_compat.c Fri Feb 17 03:33:06 2006 +++ xorp-1.2-ok/libxorp/ether_compat.c Mon Mar 13 18:07:08 2006 @@ -1,4 +1,5 @@ /* -*- c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t -*- */ +/* vim:set sts=4 ts=8: */ /* * Copyright (c) 2001-2005 International Computer Science Institute @@ -95,50 +96,26 @@ #endif /* !HAVE_ETHER_NTOA */ #ifndef HAVE_ETHER_ATON - -/* Hex digit to integer. */ -#ifdef __STDC__ -inline -#endif -static int -xdtoi(int c) -{ - if (isdigit(c)) - return (c - '0'); - else if (islower(c)) - return (c - 'a' + 10); - else - return (c - 'A' + 10); -} - /* - * Convert 's' which has the form "xx:xx:xx:xx:xx:xx" into a new + * Convert 's' which has the form "x:x:x:x:x:x" into a new * ethernet address. - * XXX: Does not perform stringent checks on the format of the input string. * XXX: returns a pointer to static storage. */ struct ether_addr * ether_aton(const char *s) { - static struct ether_addr o; - uint8_t *ep, *e; - unsigned int d; - - e = ep = (uint8_t *)&o; - - while (*s) { - if (*s == ':') - s += 1; - d = xdtoi(*s++); - if (isxdigit((uint8_t)*s)) { - d <<= 4; - d |= xdtoi(*s++); - } else { - return (NULL); - } - *ep++ = d; - } + int i; + static struct ether_addr o; + unsigned int od[6]; + + i = sscanf(s, "%x:%x:%x:%x:%x:%x", + &od[0], &od[1], &od[2], &od[3], &od[4], &od[5]); + if (i != 6) + return (NULL); + + for (i = 0; i < 6; i++) + o.octet[i] = od[i]; - return (&o); + return (&o); } #endif /* !HAVE_ETHER_ATON */ diff -uNr -x *.sh -x Makefile* -x *.Po -x *.nsi -x *.exe xorp-1.2/rtrmgr/module_manager.cc xorp-1.2-ok/rtrmgr/module_manager.cc --- xorp-1.2/rtrmgr/module_manager.cc Wed Feb 8 17:24:29 2006 +++ xorp-1.2-ok/rtrmgr/module_manager.cc Mon Mar 13 12:08:07 2006 @@ -679,15 +679,18 @@ int ModuleManager::Process::startup(string& error_msg) { + list empty_args; + XLOG_ASSERT(_run_command == NULL); - _run_command = new RunShellCommand( + _run_command = new RunCommand( _mmgr.eventloop(), _expath, - string(""), // XXX: no arguments allowed + empty_args, // XXX: no arguments allowed callback(this, &ModuleManager::Process::stdout_cb), callback(this, &ModuleManager::Process::stderr_cb), - callback(this, &ModuleManager::Process::done_cb)); + callback(this, &ModuleManager::Process::done_cb), + true); _run_command->set_stopped_cb( callback(this, &ModuleManager::Process::stopped_cb)); if (_run_command->execute() != XORP_OK) { @@ -716,7 +719,7 @@ } void -ModuleManager::Process::stdout_cb(RunShellCommand* run_command, +ModuleManager::Process::stdout_cb(RunCommand* run_command, const string& output) { XLOG_ASSERT(run_command == _run_command); @@ -725,7 +728,7 @@ } void -ModuleManager::Process::stderr_cb(RunShellCommand* run_command, +ModuleManager::Process::stderr_cb(RunCommand* run_command, const string& output) { XLOG_ASSERT(run_command == _run_command); @@ -734,7 +737,7 @@ } void -ModuleManager::Process::done_cb(RunShellCommand* run_command, bool success, +ModuleManager::Process::done_cb(RunCommand* run_command, bool success, const string& error_msg) { XLOG_ASSERT(run_command == _run_command); @@ -759,7 +762,7 @@ } void -ModuleManager::Process::stopped_cb(RunShellCommand* run_command, +ModuleManager::Process::stopped_cb(RunCommand* run_command, int stop_signal) { XLOG_ASSERT(run_command == _run_command); diff -uNr -x *.sh -x Makefile* -x *.Po -x *.nsi -x *.exe xorp-1.2/rtrmgr/module_manager.hh xorp-1.2-ok/rtrmgr/module_manager.hh --- xorp-1.2/rtrmgr/module_manager.hh Wed Feb 8 17:24:29 2006 +++ xorp-1.2-ok/rtrmgr/module_manager.hh Mon Mar 13 12:08:07 2006 @@ -30,7 +30,7 @@ class MasterConfigTree; class ModuleManager; class Rtrmgr; -class RunShellCommand; +class RunCommand; class Module : public GenericModule { @@ -122,15 +122,15 @@ void terminate_with_prejudice(); private: - void stdout_cb(RunShellCommand* run_command, const string& output); - void stderr_cb(RunShellCommand* run_command, const string& output); - void done_cb(RunShellCommand* run_command, bool success, + void stdout_cb(RunCommand* run_command, const string& output); + void stderr_cb(RunCommand* run_command, const string& output); + void done_cb(RunCommand* run_command, bool success, const string& error_msg); - void stopped_cb(RunShellCommand* run_command, int stop_signal); + void stopped_cb(RunCommand* run_command, int stop_signal); ModuleManager& _mmgr; string _expath; - RunShellCommand* _run_command; + RunCommand* _run_command; }; private: