1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Rewrote interface type detection logic. The `unnumbered' flag is now per

address, not per interface (hence it's ifa->flags & IA_UNNUMBERED) and
should be set reliably. IF_MULTIACCESS should be fixed now, but it isn't
wise to rely on it on interfaces configured with /30 prefix.
This commit is contained in:
Martin Mares
2000-02-29 23:19:52 +00:00
parent e69e4ed934
commit 6a636392d3
6 changed files with 79 additions and 63 deletions

View File

@@ -94,12 +94,15 @@ scan_ifs(struct ifreq *r, int cnt)
if (fl & IFF_POINTOPOINT)
{
i.flags |= IF_UNNUMBERED;
a.pxlen = BITS_PER_IP_ADDRESS;
a.flags |= IA_UNNUMBERED;
if (ioctl(if_scan_sock, SIOCGIFDSTADDR, r) < 0)
{ err = "SIOCGIFDSTADDR"; goto faulty; }
get_sockaddr((struct sockaddr_in *) &r->ifr_addr, &a.opposite, NULL);
a.prefix = a.opposite;
a.pxlen = BITS_PER_IP_ADDRESS;
}
else
a.prefix = ipa_and(a.ip, ipa_mkmask(a.pxlen));
if (fl & IFF_LOOPBACK)
i.flags |= IF_LOOPBACK | IF_IGNORE;
if (1
@@ -107,12 +110,11 @@ scan_ifs(struct ifreq *r, int cnt)
&& (fl & IFF_MULTICAST)
#endif
#ifndef CONFIG_UNNUM_MULTICAST
&& !(i.flags & IF_UNNUMBERED)
&& !(a.flags & IA_UNNUMBERED)
#endif
)
i.flags |= IF_MULTICAST;
a.prefix = ipa_and(a.ip, ipa_mkmask(a.pxlen));
if (a.pxlen < 32)
{
a.brd = ipa_or(a.prefix, ipa_not(ipa_mkmask(a.pxlen)));