summaryrefslogtreecommitdiff
path: root/zebra/rt_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r--zebra/rt_netlink.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index e8333ef0cf..3830e1fbde 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -98,7 +98,7 @@ static inline int is_selfroute(int proto)
|| (proto == RTPROT_ISIS) || (proto == RTPROT_RIPNG)
|| (proto == RTPROT_NHRP) || (proto == RTPROT_EIGRP)
|| (proto == RTPROT_LDP) || (proto == RTPROT_BABEL)
- || (proto == RTPROT_RIP)) {
+ || (proto == RTPROT_RIP) || (proto == RTPROT_SHARP)) {
return 1;
}
@@ -139,6 +139,9 @@ static inline int zebra2proto(int proto)
case ZEBRA_ROUTE_LDP:
proto = RTPROT_LDP;
break;
+ case ZEBRA_ROUTE_SHARP:
+ proto = RTPROT_SHARP;
+ break;
default:
proto = RTPROT_ZEBRA;
break;
@@ -1605,7 +1608,23 @@ int kernel_route_rib(struct prefix *p, struct prefix *src_p,
if (old && !new)
return netlink_route_multipath(RTM_DELROUTE, p, src_p, old, 0);
- return netlink_route_multipath(RTM_NEWROUTE, p, src_p, new, 1);
+ if (p->family == AF_INET)
+ return netlink_route_multipath(RTM_NEWROUTE, p, src_p, new, 1);
+
+ /*
+ * So v6 route replace semantics are not in the kernel at this
+ * point as I understand it.
+ * So let's do a delete than an add.
+ * In the future once v6 route replace semantics are in
+ * we can figure out what to do here to allow working
+ * with old and new kernels.
+ *
+ * I'm also intentionally ignoring the failure case
+ * of the route delete. If that happens yeah we're
+ * screwed.
+ */
+ netlink_route_multipath(RTM_DELROUTE, p, src_p, old, 0);
+ return netlink_route_multipath(RTM_NEWROUTE, p, src_p, new, 0);
}
int kernel_neigh_update(int add, int ifindex, uint32_t addr, char *lla,