diff mbox series

[OpenWrt-Devel,1/3] netifd: fix xfrm interface deletion and standardize netlink call

Message ID 20190614110947.10540-2-avalentin@marcant.net
State Accepted
Delegated to: Hans Dedecker
Headers show
Series xfrm: fix xfrm interface deletion and improve module loading | expand

Commit Message

André Valentin June 14, 2019, 11:09 a.m. UTC
-xfrm interfaces were deleted before
-use standard parameters for xfrm interface created

Signed-off-by: André Valentin <avalentin@marcant.net>
---
 system-linux.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Hans Dedecker June 15, 2019, 7:24 p.m. UTC | #1
On Fri, Jun 14, 2019 at 1:10 PM André Valentin <avalentin@marcant.net> wrote:
>
> -xfrm interfaces were deleted before
> -use standard parameters for xfrm interface created
>
> Signed-off-by: André Valentin <avalentin@marcant.net>
Patch merged; thx

Hans
> ---
>  system-linux.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/system-linux.c b/system-linux.c
> index 6e5ca28..f63aeb2 100644
> --- a/system-linux.c
> +++ b/system-linux.c
> @@ -2883,7 +2883,7 @@ static int system_add_xfrm_tunnel(const char *name, const char *kind,
>         struct blob_attr *cur;
>         int ret = 0;
>
> -       nlm = nlmsg_alloc_simple(RTM_NEWLINK, NLM_F_REQUEST | NLM_F_ACK | NLM_F_CREATE | NLM_F_EXCL);
> +       nlm = nlmsg_alloc_simple(RTM_NEWLINK, NLM_F_REQUEST | NLM_F_REPLACE | NLM_F_CREATE);
>         if (!nlm)
>                 return -1;
>
> @@ -3216,7 +3216,8 @@ static int __system_del_ip_tunnel(const char *name, struct blob_attr **tb)
>         if (!strcmp(str, "greip") || !strcmp(str, "gretapip") ||
>             !strcmp(str, "greip6") || !strcmp(str, "gretapip6") ||
>             !strcmp(str, "vtiip") || !strcmp(str, "vtiip6") ||
> -           !strcmp(str, "vxlan") || !strcmp(str, "vxlan6"))
> +           !strcmp(str, "vxlan") || !strcmp(str, "vxlan6") ||
> +           !strcmp(str, "xfrm"))
>                 return system_link_del(name);
>         else
>                 return tunnel_ioctl(name, SIOCDELTUNNEL, NULL);
> --
> 2.11.0
>
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
diff mbox series

Patch

diff --git a/system-linux.c b/system-linux.c
index 6e5ca28..f63aeb2 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -2883,7 +2883,7 @@  static int system_add_xfrm_tunnel(const char *name, const char *kind,
 	struct blob_attr *cur;
 	int ret = 0;
 
-	nlm = nlmsg_alloc_simple(RTM_NEWLINK, NLM_F_REQUEST | NLM_F_ACK | NLM_F_CREATE | NLM_F_EXCL);
+	nlm = nlmsg_alloc_simple(RTM_NEWLINK, NLM_F_REQUEST | NLM_F_REPLACE | NLM_F_CREATE);
 	if (!nlm)
 		return -1;
 
@@ -3216,7 +3216,8 @@  static int __system_del_ip_tunnel(const char *name, struct blob_attr **tb)
 	if (!strcmp(str, "greip") || !strcmp(str, "gretapip") ||
 	    !strcmp(str, "greip6") || !strcmp(str, "gretapip6") ||
 	    !strcmp(str, "vtiip") || !strcmp(str, "vtiip6") ||
-	    !strcmp(str, "vxlan") || !strcmp(str, "vxlan6"))
+	    !strcmp(str, "vxlan") || !strcmp(str, "vxlan6") ||
+	    !strcmp(str, "xfrm"))
 		return system_link_del(name);
 	else
 		return tunnel_ioctl(name, SIOCDELTUNNEL, NULL);