if ((ifreq.ifr_flags & IFF_LOOPBACK) != 0)
iter->current.flags |= INTERFACE_F_LOOPBACK;
+ if ((lifreq.lifr_flags & IFF_BROADCAST) != 0) {
+ iter->current.flags |= INTERFACE_F_BROADCAST;
+ }
+
+ if ((lifreq.lifr_flags & IFF_MULTICAST) != 0) {
+ iter->current.flags |= INTERFACE_F_MULTICAST;
+ }
+
#if !defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR)
if (family == AF_INET)
goto inet;
(struct sockaddr *)&ifreq.ifr_dstaddr);
}
+ if ((iter->current.flags & INTERFACE_F_BROADCAST) != 0) {
+ /*
+ * Ignore the HP/UX warning about "interger overflow during
+ * conversion. It comes from its own macro definition,
+ * and is really hard to shut up.
+ */
+ if (ioctl(iter->socket, SIOCGLIFBRDADDR, (char *)&ifreq)
+ < 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"),
+ ifreq.ifr_name, strbuf);
+ return (ISC_R_IGNORE);
+ }
+ get_addr(family, &iter->current.broadcast,
+ (struct sockaddr *)&ifreq.lifr_broadaddr);
+ }
/*
* Get the network mask.
*/
if ((lifreq.lifr_flags & IFF_LOOPBACK) != 0)
iter->current.flags |= INTERFACE_F_LOOPBACK;
+ if ((lifreq.lifr_flags & IFF_BROADCAST) != 0) {
+ iter->current.flags |= INTERFACE_F_BROADCAST;
+ }
+
+ if ((lifreq.lifr_flags & IFF_MULTICAST) != 0) {
+ iter->current.flags |= INTERFACE_F_MULTICAST;
+ }
+
/*
* If the interface is point-to-point, get the destination address.
*/
(struct sockaddr *)&lifreq.lifr_dstaddr);
}
+ if ((iter->current.flags & INTERFACE_F_BROADCAST) != 0) {
+ /*
+ * Ignore the HP/UX warning about "interger overflow during
+ * conversion. It comes from its own macro definition,
+ * and is really hard to shut up.
+ */
+ if (ioctl(iter->socket, SIOCGLIFBRDADDR, (char *)&ifreq)
+ < 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"),
+ ifreq.ifr_name, strbuf);
+ return (ISC_R_IGNORE);
+ }
+ get_addr(family, &iter->current.broadcast,
+ (struct sockaddr *)&ifreq.lifr_broadaddr);
+ }
+
/*
* Get the network mask.
*/
if ((ifam->ifam_flags & IFF_LOOPBACK) != 0)
iter->current.flags |= INTERFACE_F_LOOPBACK;
+ if ((ifam->ifam_flags & IFF_BROADCAST) != 0) {
+ iter->current.flags |= INTERFACE_F_BROADCAST;
+ }
+
+ if ((ifam->ifam_flags & IFF_MULTICAST) != 0) {
+ iter->current.flags |= INTERFACE_F_MULTICAST;
+ }
/*
* This is not an interface address.
* Force another iteration.
if (dst_sa != NULL &&
(iter->current.flags & IFF_POINTOPOINT) != 0)
get_addr(family, &iter->current.dstaddress, dst_sa);
+ if (dst_sa != NULL &&
+ (iter->current.flags & IFF_BROADCAST) != 0)
+ get_addr(family, &iter->current.broadcast, dst_sa);
return (ISC_R_SUCCESS);
} else {