]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
If a broadcast address is missing, go fake one.
authorMartin Mares <mj@ucw.cz>
Thu, 11 May 2000 12:30:06 +0000 (12:30 +0000)
committerMartin Mares <mj@ucw.cz>
Thu, 11 May 2000 12:30:06 +0000 (12:30 +0000)
TODO
sysdep/linux/netlink/netlink.c

diff --git a/TODO b/TODO
index f829e83143403b5158923270fb761e4da3e8de1a..51802994242d3c8f27396516e519ca9daa7fc600 100644 (file)
--- a/TODO
+++ b/TODO
@@ -27,8 +27,6 @@ Core
 
 - proto: Don't show repeated `Changed state to ...' messages if only internal states change
 
-- iface: Don't complain about missing broadcast addresses.
-
 Documentation
 ~~~~~~~~~~~~~
 - write doctool
index db744135344e9d46d5018168a16e836c65b234d7..70abdd738ea7d652f65ae0d9414798f5e4404b0f 100644 (file)
@@ -374,6 +374,7 @@ nl_parse_addr(struct nlmsghdr *h)
     }
   else
     {
+      ip_addr netmask = ipa_mkmask(ifa.pxlen);
 #ifndef IPV6
       if (i->ifa_prefixlen == BITS_PER_IP_ADDRESS - 2)
        ifa.opposite = ipa_opposite(ifa.ip);
@@ -382,8 +383,10 @@ nl_parse_addr(struct nlmsghdr *h)
          memcpy(&ifa.brd, RTA_DATA(a[IFA_BROADCAST]), sizeof(ifa.brd));
          ipa_ntoh(ifa.brd);
        }
+      else
+       ifa.brd = ipa_or(ifa.ip, ipa_not(netmask));
 #endif
-      ifa.prefix = ipa_and(ifa.ip, ipa_mkmask(ifa.pxlen));
+      ifa.prefix = ipa_and(ifa.ip, netmask);
     }
 
   DBG("KIF: IF%d(%s): %s IPA %I, flg %x, net %I/%d, brd %I, opp %I\n",