summaryrefslogtreecommitdiffstats
path: root/nest/iface.c
diff options
context:
space:
mode:
Diffstat (limited to 'nest/iface.c')
-rw-r--r--nest/iface.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/nest/iface.c b/nest/iface.c
index a80e973..4d0cf04 100644
--- a/nest/iface.c
+++ b/nest/iface.c
@@ -588,12 +588,20 @@ iface_patt_match(struct iface_patt *ifp, struct iface *i, struct ifa *a)
continue;
}
- // FIXME there should be check for prefix in prefix. (?)
- if (p->pxlen)
- if (!a || !ipa_in_net(a->ip, p->prefix, p->pxlen))
- continue;
+ if (p->pxlen == 0)
+ return pos;
- return pos;
+ if (!a)
+ continue;
+
+ if (ipa_in_net(a->ip, p->prefix, p->pxlen))
+ return pos;
+
+ if ((a->flags & IA_UNNUMBERED) &&
+ ipa_in_net(a->opposite, p->prefix, p->pxlen))
+ return pos;
+
+ continue;
}
return 0;