summaryrefslogtreecommitdiffstats
path: root/ospfd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-11-16 21:48:07 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-11-16 21:48:07 +0100
commitd44ca835fc8000889a92b98af5a22b8139b2a3b7 (patch)
tree712e5a01505fb20505cb0a5d5fad10077a73cdb6 /ospfd
parentBGP: Fix nexthop registration churn (diff)
downloadfrr-d44ca835fc8000889a92b98af5a22b8139b2a3b7.tar.xz
frr-d44ca835fc8000889a92b98af5a22b8139b2a3b7.zip
Zebra: Remove reliance on NEXTHOP_TYPE_IPV4_ONLINK
Zebra already knows if an interface is unnumbered or not. This is communicated to OSPF. OSPF would only send a NEXTHOP_TYPE_IPV4_ONLINK *if* the path was unnumbered, which it learns from Zebra. As such, Have OSPF use the normal NEXTHOP_TYPE_IPV4_IFINDEX type for unnumbered paths. In Zebra, if the ifindex recieved is unnumbered then assume that the link is NEXTHOP_FLAG_ONLINK. Ticket: CM-8145 Reviewed-by: CCR-3771 Testing: See bug Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_zebra.c53
1 files changed, 21 insertions, 32 deletions
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c
index 4408627fd..0d77e8d3a 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -387,38 +387,27 @@ ospf_zebra_add (struct prefix_ipv4 *p, struct ospf_route *or)
for (ALL_LIST_ELEMENTS_RO (or->paths, node, path))
{
#ifdef HAVE_NETLINK
- if (path->unnumbered)
- {
- stream_putc (s, ZEBRA_NEXTHOP_IPV4_ONLINK);
- stream_put_in_addr (s, &path->nexthop);
- if (path->ifindex)
- stream_putl (s, path->ifindex);
- else
- stream_putl (s, 0);
- }
- else
- {
- if (path->nexthop.s_addr != INADDR_ANY &&
- path->ifindex != 0)
- {
- stream_putc (s, ZEBRA_NEXTHOP_IPV4_IFINDEX);
- stream_put_in_addr (s, &path->nexthop);
- stream_putl (s, path->ifindex);
- }
- else if (path->nexthop.s_addr != INADDR_ANY)
- {
- stream_putc (s, ZEBRA_NEXTHOP_IPV4);
- stream_put_in_addr (s, &path->nexthop);
- }
- else
- {
- stream_putc (s, ZEBRA_NEXTHOP_IFINDEX);
- if (path->ifindex)
- stream_putl (s, path->ifindex);
- else
- stream_putl (s, 0);
- }
- }
+ if (path->unnumbered ||
+ (path->nexthop.s_addr != INADDR_ANY &&
+ path->ifindex != 0))
+ {
+ stream_putc (s, ZEBRA_NEXTHOP_IPV4_IFINDEX);
+ stream_put_in_addr (s, &path->nexthop);
+ stream_putl (s, path->ifindex);
+ }
+ else if (path->nexthop.s_addr != INADDR_ANY)
+ {
+ stream_putc (s, ZEBRA_NEXTHOP_IPV4);
+ stream_put_in_addr (s, &path->nexthop);
+ }
+ else
+ {
+ stream_putc (s, ZEBRA_NEXTHOP_IFINDEX);
+ if (path->ifindex)
+ stream_putl (s, path->ifindex);
+ else
+ stream_putl (s, 0);
+ }
#else /* HAVE_NETLINK */
if (path->nexthop.s_addr != INADDR_ANY &&
path->ifindex != 0)