From: Frank Kardel Date: Mon, 22 Aug 2005 12:05:51 +0000 (+0000) Subject: ntp_io.c: X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b19779f41808fe91f9b44537cb0878a325dfd4b7;p=thirdparty%2Fntp.git ntp_io.c: fix list initialization for interface->peer correct initizalization of loopback_interface global bk: 4309bf9fys65CGEfGnaGQ8yh2NBHXw --- diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c index c61a2b2116..5aecf35174 100644 --- a/ntpd/ntp_io.c +++ b/ntpd/ntp_io.c @@ -447,6 +447,7 @@ static void init_interface(interface_t *interface) { ISC_LINK_INIT(interface, link); + ISC_LIST_INIT(interface->peers); interface->fd = INVALID_SOCKET; interface->bfd = INVALID_SOCKET; interface->num_mcast = 0; @@ -878,6 +879,13 @@ update_interfaces( * this is new - add to out interface list */ iface = create_interface(port, iface); + /* + * in case we just dug out a loopback interface + * let it point to the correctly created one + */ + if (loopback_interface == &interface) + loopback_interface = iface; + ifi.action = IFS_CREATED; ifi.interface = iface; if (receiver && iface)