summaryrefslogtreecommitdiffstats
path: root/nest
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-03-14 16:36:59 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2010-03-14 16:36:59 +0100
commit0aad2b9292f8e5ff32d048378faf80d2d0bfbb80 (patch)
treee245c5adb1392fee5d402b25823b558969f9cd13 /nest
parent54305181f6ee3af57dd3d15d53ea2e851b36ed23 (diff)
downloadbird-0aad2b9292f8e5ff32d048378faf80d2d0bfbb80.tar
bird-0aad2b9292f8e5ff32d048378faf80d2d0bfbb80.zip
Temporary OSPF commit - sockets.
Diffstat (limited to 'nest')
-rw-r--r--nest/iface.c11
-rw-r--r--nest/iface.h3
-rw-r--r--nest/rt-dev.c2
3 files changed, 9 insertions, 7 deletions
diff --git a/nest/iface.c b/nest/iface.c
index 82dead3..a80e973 100644
--- a/nest/iface.c
+++ b/nest/iface.c
@@ -566,8 +566,8 @@ if_init(void)
* Interface Pattern Lists
*/
-static int
-iface_patt_match(struct iface_patt *ifp, struct iface *i)
+int
+iface_patt_match(struct iface_patt *ifp, struct iface *i, struct ifa *a)
{
struct iface_patt_node *p;
@@ -588,8 +588,9 @@ iface_patt_match(struct iface_patt *ifp, struct iface *i)
continue;
}
+ // FIXME there should be check for prefix in prefix. (?)
if (p->pxlen)
- if (!i->addr || !ipa_in_net(i->addr->ip, p->prefix, p->pxlen))
+ if (!a || !ipa_in_net(a->ip, p->prefix, p->pxlen))
continue;
return pos;
@@ -599,12 +600,12 @@ iface_patt_match(struct iface_patt *ifp, struct iface *i)
}
struct iface_patt *
-iface_patt_find(list *l, struct iface *i)
+iface_patt_find(list *l, struct iface *i, struct ifa *a)
{
struct iface_patt *p;
WALK_LIST(p, *l)
- if (iface_patt_match(p, i))
+ if (iface_patt_match(p, i, a))
return p;
return NULL;
diff --git a/nest/iface.h b/nest/iface.h
index 873734d..c116db8 100644
--- a/nest/iface.h
+++ b/nest/iface.h
@@ -144,7 +144,8 @@ struct iface_patt {
/* Protocol-specific data follow after this structure */
};
-struct iface_patt *iface_patt_find(list *, struct iface *);
+int iface_patt_match(struct iface_patt *ifp, struct iface *i, struct ifa *a);
+struct iface_patt *iface_patt_find(list *l, struct iface *i, struct ifa *a);
int iface_patts_equal(list *, list *, int (*)(struct iface_patt *, struct iface_patt *));
#endif
diff --git a/nest/rt-dev.c b/nest/rt-dev.c
index bb8eb8e..239bd26 100644
--- a/nest/rt-dev.c
+++ b/nest/rt-dev.c
@@ -30,7 +30,7 @@ dev_ifa_notify(struct proto *p, unsigned c, struct ifa *ad)
struct rt_dev_config *P = (void *) p->cf;
if (!EMPTY_LIST(P->iface_list) &&
- !iface_patt_find(&P->iface_list, ad->iface))
+ !iface_patt_find(&P->iface_list, ad->iface, ad->iface->addr))
/* Empty list is automagically treated as "*" */
return;