]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Broadcast addresses were not being set for systems with IPv6 capability
authorDanny Mayer <mayer@ntp.org>
Wed, 7 Jan 2004 01:55:01 +0000 (20:55 -0500)
committerDanny Mayer <mayer@ntp.org>
Wed, 7 Jan 2004 01:55:01 +0000 (20:55 -0500)
bk: 3ffb66f5e4WlWRdvNSl2e9uBVKVGoQ

libisc/ifiter_ioctl.c

index cd0ced87c2ba093b7882592362711c8eb0b58e74..b83c2fbae0f13623c5886cdf5515f8b480774e38 100644 (file)
@@ -704,6 +704,27 @@ internal_current6(isc_interfaceiter_t *iter) {
                get_addr(family, &iter->current.dstaddress,
                         (struct sockaddr *)&lifreq.lifr_dstaddr);
        }
+       if ((iter->current.flags & INTERFACE_F_BROADCAST) != 0) {
+               /*
+                * Ignore the HP/UX warning about "integer overflow during
+                * conversion.  It comes from its own macro definition,
+                * and is really hard to shut up.
+                */
+               if (ioctl(iter->socket, SIOCGLIFBRDADDR, (char *)&lifreq)
+                   < 0) {
+                       isc__strerror(errno, strbuf, sizeof(strbuf));
+                       UNEXPECTED_ERROR(__FILE__, __LINE__,
+                               isc_msgcat_get(isc_msgcat,
+                                              ISC_MSGSET_IFITERIOCTL,
+                                              ISC_MSG_GETDESTADDR,
+                                              "%s: getting "
+                                              "broadcast address: %s"),
+                                        lifreq.lifr_name, strbuf);
+                       return (ISC_R_IGNORE);
+               }
+               get_addr(family, &iter->current.broadcast,
+                        (struct sockaddr *)&lifreq.lifr_broadaddr);
+       }
 
 
        /*