diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-03-01 19:56:12 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-03-01 19:56:12 +0100 |
commit | 334734a8b6b32c28393fc318fb96e647363fbaec (patch) | |
tree | 51536f66acf7203921db582aea0f39476a15b1c4 /zebra | |
parent | Merge pull request #3882 from vivek-cumulus/refine_evpn_route_add (diff) | |
download | frr-334734a8b6b32c28393fc318fb96e647363fbaec.tar.xz frr-334734a8b6b32c28393fc318fb96e647363fbaec.zip |
zebra: When installing a new route always use REPLACE
When we install a new route into the kernel always use
REPLACE. Else if the route is already there it can
be translated into an append with the flags we are
using.
This is especially true for the way we handle pbr
routes as that we are re-installing the same route
entry from pbr at the moment.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/rt_netlink.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 3868412b2..18cf389d5 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -1466,10 +1466,9 @@ static int netlink_route_multipath(int cmd, struct zebra_dplane_ctx *ctx) req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg)); req.n.nlmsg_flags = NLM_F_CREATE | NLM_F_REQUEST; - if (dplane_ctx_get_op(ctx) == DPLANE_OP_ROUTE_UPDATE) { - if ((p->family == AF_INET) || v6_rr_semantics) - req.n.nlmsg_flags |= NLM_F_REPLACE; - } + if ((cmd == RTM_NEWROUTE) && + ((p->family == AF_INET) || v6_rr_semantics)) + req.n.nlmsg_flags |= NLM_F_REPLACE; req.n.nlmsg_type = cmd; |