]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ntp_io.c:
authorFrank Kardel <kardel@ntp.org>
Mon, 22 Aug 2005 12:05:51 +0000 (12:05 +0000)
committerFrank Kardel <kardel@ntp.org>
Mon, 22 Aug 2005 12:05:51 +0000 (12:05 +0000)
  fix list initialization for interface->peer
  correct initizalization of loopback_interface global

bk: 4309bf9fys65CGEfGnaGQ8yh2NBHXw

ntpd/ntp_io.c

index c61a2b2116cca2eccea68b515f46fb30b196e3cd..5aecf35174d54b327763c29456323639ba880822 100644 (file)
@@ -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)