diff mbox series

netfilter: ipset: fix ip_set_byindex function

Message ID 20181127161556.19635-1-florent.fourcot@wifirst.fr
State Accepted
Delegated to: Jozsef Kadlecsik
Headers show
Series netfilter: ipset: fix ip_set_byindex function | expand

Commit Message

Florent Fourcot Nov. 27, 2018, 4:15 p.m. UTC
New function added by "Introduction of new commands and protocol
version 7" is not working, since we return skb2 to user

Signed-off-by: Victorien Molle <victorien.molle@wifirst.fr>
Signed-off-by: Florent Fourcot <florent.fourcot@wifirst.fr>
---
 net/netfilter/ipset/ip_set_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kadlecsik József Dec. 1, 2018, 4:43 p.m. UTC | #1
On Tue, 27 Nov 2018, Florent Fourcot wrote:

> New function added by "Introduction of new commands and protocol
> version 7" is not working, since we return skb2 to user

Oh my, I dunno, maybe copy&paste bug.

Thanks, patch is applied.

Best regards,
Jozsef

> Signed-off-by: Victorien Molle <victorien.molle@wifirst.fr>
> Signed-off-by: Florent Fourcot <florent.fourcot@wifirst.fr>
> ---
>  net/netfilter/ipset/ip_set_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
> index 1c3614aca34e..e3113aa1a975 100644
> --- a/net/netfilter/ipset/ip_set_core.c
> +++ b/net/netfilter/ipset/ip_set_core.c
> @@ -1949,7 +1949,7 @@ static int ip_set_byindex(struct net *net, struct sock *ctnl,
>  	if (!nlh2)
>  		goto nlmsg_failure;
>  	if (nla_put_u8(skb2, IPSET_ATTR_PROTOCOL, protocol(attr)) ||
> -	    nla_put_string(skb, IPSET_ATTR_SETNAME, set->name))
> +	    nla_put_string(skb2, IPSET_ATTR_SETNAME, set->name))
>  		goto nla_put_failure;
>  	nlmsg_end(skb2, nlh2);
>  
> -- 
> 2.11.0
> 
> 

-
E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.mta.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
          H-1525 Budapest 114, POB. 49, Hungary
diff mbox series

Patch

diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
index 1c3614aca34e..e3113aa1a975 100644
--- a/net/netfilter/ipset/ip_set_core.c
+++ b/net/netfilter/ipset/ip_set_core.c
@@ -1949,7 +1949,7 @@  static int ip_set_byindex(struct net *net, struct sock *ctnl,
 	if (!nlh2)
 		goto nlmsg_failure;
 	if (nla_put_u8(skb2, IPSET_ATTR_PROTOCOL, protocol(attr)) ||
-	    nla_put_string(skb, IPSET_ATTR_SETNAME, set->name))
+	    nla_put_string(skb2, IPSET_ATTR_SETNAME, set->name))
 		goto nla_put_failure;
 	nlmsg_end(skb2, nlh2);