summaryrefslogtreecommitdiff
path: root/sysdep/unix/krt-iface.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-04-28 00:39:57 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2010-04-28 00:39:57 +0200
commitba321706578de8402d50214a9e79a65835cdd821 (patch)
treea76b5e241ed7f7c698890f2f9fd26a3c35ed07b2 /sysdep/unix/krt-iface.c
parent48b0814ace2d05f9fef093d9f309bfa186a6f365 (diff)
Better support for /31 networks.
Diffstat (limited to 'sysdep/unix/krt-iface.c')
-rw-r--r--sysdep/unix/krt-iface.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sysdep/unix/krt-iface.c b/sysdep/unix/krt-iface.c
index e0158b6b..5fda0d1d 100644
--- a/sysdep/unix/krt-iface.c
+++ b/sysdep/unix/krt-iface.c
@@ -89,7 +89,7 @@ scan_ifs(struct ifreq *r, int cnt)
{ err = "SIOCGIFNETMASK"; goto faulty; }
get_sockaddr((struct sockaddr_in *) &r->ifr_addr, &netmask, NULL, 0);
l = ipa_mklen(netmask);
- if (l < 0 || l == 31)
+ if (l < 0)
{
log(L_ERR "%s: Invalid netmask (%x)", i.name, netmask);
goto bad;
@@ -139,8 +139,10 @@ scan_ifs(struct ifreq *r, int cnt)
i.flags |= IF_BROADCAST;
if (a.pxlen < 30)
i.flags |= IF_MULTIACCESS;
- else
- a.opposite = ipa_opposite(a.ip, a.pxlen);
+ if (a.pxlen == 30)
+ ifa.opposite = ipa_opposite_m2(ifa.ip);
+ if (a.pxlen == 31)
+ ifa.opposite = ipa_opposite_m1(ifa.ip);
}
else
a.brd = a.opposite;