summaryrefslogtreecommitdiffstats
path: root/proto
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2010-11-04 10:55:48 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2010-11-04 10:55:48 +0100
commit9d35f8c51f1062ddd8e2f41cf535d8a8d69ec6be (patch)
tree1fd0c3132743dadc8d89b0e8b9497e6f6ed2a305 /proto
parenta244c5524b30874e24fc4dfbdb8cef243bd33178 (diff)
downloadbird-9d35f8c51f1062ddd8e2f41cf535d8a8d69ec6be.tar
bird-9d35f8c51f1062ddd8e2f41cf535d8a8d69ec6be.zip
OSPF, RIP: Only accept unicast routes
Diffstat (limited to 'proto')
-rw-r--r--proto/ospf/ospf.c3
-rw-r--r--proto/rip/rip.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c
index a9dc1de..ed82a55 100644
--- a/proto/ospf/ospf.c
+++ b/proto/ospf/ospf.c
@@ -468,6 +468,9 @@ ospf_import_control(struct proto *p, rte ** new, ea_list ** attrs,
if (p == e->attrs->proto)
return -1; /* Reject our own routes */
+ if (e->attrs->cast != RTC_UNICAST)
+ return -1;
+
eattr *ea = ea_find(e->attrs->eattrs, EA_GEN_IGP_METRIC);
u32 m1 = (ea && (ea->u.data < LSINFINITY)) ? ea->u.data : LSINFINITY;
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index 4b3de2e..920af3a 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -841,6 +841,9 @@ rip_import_control(struct proto *p, struct rte **rt, struct ea_list **attrs, str
if ((*rt)->attrs->proto == p) /* My own must not be touched */
return 1;
+ if ((*rt)->attrs->cast != RTC_UNICAST)
+ return -1;
+
if ((*rt)->attrs->source != RTS_RIP) {
struct ea_list *new = rip_gen_attrs(pool, 1, 0);
new->next = *attrs;