Correctly form the delete route/route6 request.
authorBenjamin Cama <benoar@dolka.fr>
Sat, 20 Aug 2011 16:23:58 +0000 (18:23 +0200)
committerBenjamin Cama <benoar@dolka.fr>
Sat, 20 Aug 2011 16:24:54 +0000 (18:24 +0200)
Signed-off-by: Benjamin Cama <benoar@dolka.fr>
l2tpns.c

index 5545aed..bab453f 100644 (file)
--- a/l2tpns.c
+++ b/l2tpns.c
@@ -444,7 +444,11 @@ static void routeset(sessionidt s, in_addr_t ip, int prefixlen, in_addr_t gw, in
                req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE | NLM_F_REPLACE;
        }
        else
                req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE | NLM_F_REPLACE;
        }
        else
+       {
                req.nh.nlmsg_type = RTM_DELROUTE;
                req.nh.nlmsg_type = RTM_DELROUTE;
+               req.nh.nlmsg_flags = NLM_F_REQUEST;
+       }
+
        req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.rt));
 
        req.rt.rtm_family = AF_INET;
        req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.rt));
 
        req.rt.rtm_family = AF_INET;
@@ -519,7 +523,11 @@ void route6set(sessionidt s, struct in6_addr ip, int prefixlen, int add)
                req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE | NLM_F_REPLACE;
        }
        else
                req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE | NLM_F_REPLACE;
        }
        else
+       {
                req.nh.nlmsg_type = RTM_DELROUTE;
                req.nh.nlmsg_type = RTM_DELROUTE;
+               req.nh.nlmsg_flags = NLM_F_REQUEST;
+       }
+
        req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.rt));
 
        req.rt.rtm_family = AF_INET6;
        req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.rt));
 
        req.rt.rtm_family = AF_INET6;