summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
Diffstat (limited to 'nest')
-rw-r--r--nest/neighbor.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/nest/neighbor.c b/nest/neighbor.c
index b8832f2f..14a6b113 100644
--- a/nest/neighbor.c
+++ b/nest/neighbor.c
@@ -81,15 +81,15 @@ if_connected(ip_addr *a, struct iface *i, struct ifa **ap)
{
if (ipa_in_netX(*a, &b->prefix))
{
-#ifndef IPV6
- if ((b->pxlen < (BITS_PER_IP_ADDRESS - 1)) &&
- (ipa_equal(*a, b->prefix) || /* Network address */
+ /* Do not allow IPv4 network and broadcast addresses */
+ if (ipa_is_ip4(*a) &&
+ (net_pxlen(&b->prefix) < (BITS_PER_IP_ADDRESS - 1)) &&
+ (ipa_equal(*a, net_prefix(&b->prefix)) || /* Network address */
ipa_equal(*a, b->brd))) /* Broadcast */
{
*ap = NULL;
return -1;
}
-#endif
return b->scope;
}