diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2010-04-28 00:39:57 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2010-04-28 00:39:57 +0200 |
commit | ba321706578de8402d50214a9e79a65835cdd821 (patch) | |
tree | a76b5e241ed7f7c698890f2f9fd26a3c35ed07b2 /nest/neighbor.c | |
parent | 48b0814ace2d05f9fef093d9f309bfa186a6f365 (diff) |
Better support for /31 networks.
Diffstat (limited to 'nest/neighbor.c')
-rw-r--r-- | nest/neighbor.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/nest/neighbor.c b/nest/neighbor.c index 25b98dbd..7e7cc491 100644 --- a/nest/neighbor.c +++ b/nest/neighbor.c @@ -75,9 +75,13 @@ if_connected(ip_addr *a, struct iface *i) /* -1=error, 1=match, 0=no match */ { if (ipa_in_net(*a, b->prefix, b->pxlen)) { - if (ipa_equal(*a, b->prefix) || /* Network address */ - ipa_equal(*a, b->brd)) /* Broadcast */ +#ifndef IPV6 + if ((b->pxlen < (BITS_PER_IP_ADDRESS - 1)) && + (ipa_equal(*a, b->prefix) || /* Network address */ + ipa_equal(*a, b->brd))) /* Broadcast */ return -1; +#endif + return b->scope; } } |