diff options
-rw-r--r-- | src/plugins/linux-cp/lcp_nl.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/linux-cp/lcp_nl.c b/src/plugins/linux-cp/lcp_nl.c index b4fef7e0b40..b548d7afa39 100644 --- a/src/plugins/linux-cp/lcp_nl.c +++ b/src/plugins/linux-cp/lcp_nl.c @@ -205,10 +205,17 @@ nl_route_del (struct rtnl_route *rr, void *arg) static void nl_route_add (struct rtnl_route *rr, void *arg) { - nl_msg_info_t *msg_info = (nl_msg_info_t *) arg; - struct nlmsghdr *nlh = nlmsg_hdr (msg_info->msg); + int is_replace = 0; - FOREACH_VFT_CTX (nvl_rt_route_add, rr, (nlh->nlmsg_flags & NLM_F_REPLACE)); + if (arg) + { + nl_msg_info_t *msg_info = (nl_msg_info_t *) arg; + struct nlmsghdr *nlh = nlmsg_hdr (msg_info->msg); + + is_replace = (nlh->nlmsg_flags & NLM_F_REPLACE); + } + + FOREACH_VFT_CTX (nvl_rt_route_add, rr, is_replace); } static void |