summaryrefslogtreecommitdiff
path: root/zebra
diff options
context:
space:
mode:
Diffstat (limited to 'zebra')
-rw-r--r--zebra/ChangeLog8
-rw-r--r--zebra/redistribute.c6
-rw-r--r--zebra/redistribute.h2
-rw-r--r--zebra/router-id.c14
4 files changed, 19 insertions, 11 deletions
diff --git a/zebra/ChangeLog b/zebra/ChangeLog
index 97dcd5f5..602de50d 100644
--- a/zebra/ChangeLog
+++ b/zebra/ChangeLog
@@ -1,3 +1,11 @@
+2007-04-07 Paul Jakma <paul.jakma@sun.com>
+
+ * redistribute.c: (zebra_check_addr) Don't redistribute routes
+ to IPv4 link-local prefixes, fixes bug #351.
+ * redistribute.h: Export zebra_check_addr.
+ * router-id.c: (router_id_bad_address) re-use zebra_check_addr
+ rather than implementing similar logic.
+
2007-03-06 Paul Jakma <paul.jakma@sun.com>
* kernel_socket.c: (ifam_read) Do not update interface metric on
diff --git a/zebra/redistribute.c b/zebra/redistribute.c
index 677e6f90..b7bd5674 100644
--- a/zebra/redistribute.c
+++ b/zebra/redistribute.c
@@ -40,7 +40,7 @@
/* master zebra server structure */
extern struct zebra_t zebrad;
-static int
+int
zebra_check_addr (struct prefix *p)
{
if (p->family == AF_INET)
@@ -50,7 +50,9 @@ zebra_check_addr (struct prefix *p)
addr = p->u.prefix4.s_addr;
addr = ntohl (addr);
- if (IPV4_NET127 (addr) || IN_CLASSD (addr))
+ if (IPV4_NET127 (addr)
+ || IN_CLASSD (addr)
+ || IPV4_LINKLOCAL(addr))
return 0;
}
#ifdef HAVE_IPV6
diff --git a/zebra/redistribute.h b/zebra/redistribute.h
index 9e78dfde..9ed99bc5 100644
--- a/zebra/redistribute.h
+++ b/zebra/redistribute.h
@@ -46,5 +46,7 @@ extern void zebra_interface_address_add_update (struct interface *,
extern void zebra_interface_address_delete_update (struct interface *,
struct connected *c);
+extern int zebra_check_addr (struct prefix *);
+
#endif /* _ZEBRA_REDISTRIBUTE_H */
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;
}