summaryrefslogtreecommitdiff
path: root/zebra/router-id.c
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@sun.com>2007-04-10 19:24:45 +0000
committerPaul Jakma <paul.jakma@sun.com>2007-04-10 19:24:45 +0000
commit6dc686a29ecdfa8f8011eee17e4e6276ab175a0d (patch)
treebd4a1f7b1c32318584bec6b4f420089aadc81b07 /zebra/router-id.c
parent37a217a59bfd32381034a0ce0adbac1c34cbec37 (diff)
[zebra] Bug #351: Don't redistribute routes to ipv4 link-local prefixes
2007-04-07 Paul Jakma <paul.jakma@sun.com> * lib/prefix.h: Add define to match IPv4 Link-Local addresses * zebra/redistribute.c: (zebra_check_addr) Don't redistribute routes to IPv4 link-local prefixes, fixes bug #351. * zebra/redistribute.h: Export zebra_check_addr. * zebra/router-id.c: (router_id_bad_address) re-use zebra_check_addr rather than implementing similar logic.
Diffstat (limited to 'zebra/router-id.c')
-rw-r--r--zebra/router-id.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/zebra/router-id.c b/zebra/router-id.c
index c73b65b5..41bab545 100644
--- a/zebra/router-id.c
+++ b/zebra/router-id.c
@@ -39,6 +39,7 @@
#include "zebra/zserv.h"
#include "zebra/router-id.h"
+#include "zebra/redistribute.h"
static struct list rid_all_sorted_list;
static struct list rid_lo_sorted_list;
@@ -63,18 +64,13 @@ router_id_find_node (struct list *l, struct connected *ifc)
static int
router_id_bad_address (struct connected *ifc)
{
- struct prefix n;
-
if (ifc->address->family != AF_INET)
return 1;
-
- n.u.prefix4.s_addr = htonl (INADDR_LOOPBACK);
- n.prefixlen = 8;
- n.family = AF_INET;
-
- if (prefix_match (&n, ifc->address))
+
+ /* non-redistributable addresses shouldn't be used for RIDs either */
+ if (!zebra_check_addr (ifc->address))
return 1;
-
+
return 0;
}