diff mbox series

src: fix parsing for set handle attributes

Message ID 20180311131800.29066-1-harshasharmaiitr@gmail.com
State Accepted
Delegated to: Pablo Neira
Headers show
Series src: fix parsing for set handle attributes | expand

Commit Message

Harsha Sharma March 11, 2018, 1:18 p.m. UTC
Correct one typo for parsing set handles.

Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
---
 src/set.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Máté Eckl March 12, 2018, 9:58 a.m. UTC | #1
Hi,

I am new here, but isn't it strange that you mask the flags with the
HANDLE attribute?

Regards,
Máté

2018-03-11 14:18 GMT+01:00 Harsha Sharma <harshasharmaiitr@gmail.com>:
> Correct one typo for parsing set handles.
>
> Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
> ---
>  src/set.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/set.c b/src/set.c
> index 0889b00..d2a7589 100644
> --- a/src/set.c
> +++ b/src/set.c
> @@ -368,7 +368,7 @@ void nftnl_set_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_set *s)
>                 mnl_attr_put_strz(nlh, NFTA_SET_TABLE, s->table);
>         if (s->flags & (1 << NFTNL_SET_NAME))
>                 mnl_attr_put_strz(nlh, NFTA_SET_NAME, s->name);
> -       if (s->handle & (1 << NFTNL_SET_HANDLE))
> +       if (s->flags & (1 << NFTNL_SET_HANDLE))
>                 mnl_attr_put_u64(nlh, NFTA_SET_HANDLE, htobe64(s->handle));
>         if (s->flags & (1 << NFTNL_SET_FLAGS))
>                 mnl_attr_put_u32(nlh, NFTA_SET_FLAGS, htonl(s->set_flags));
> --
> 2.14.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/src/set.c b/src/set.c
index 0889b00..d2a7589 100644
--- a/src/set.c
+++ b/src/set.c
@@ -368,7 +368,7 @@  void nftnl_set_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_set *s)
 		mnl_attr_put_strz(nlh, NFTA_SET_TABLE, s->table);
 	if (s->flags & (1 << NFTNL_SET_NAME))
 		mnl_attr_put_strz(nlh, NFTA_SET_NAME, s->name);
-	if (s->handle & (1 << NFTNL_SET_HANDLE))
+	if (s->flags & (1 << NFTNL_SET_HANDLE))
 		mnl_attr_put_u64(nlh, NFTA_SET_HANDLE, htobe64(s->handle));
 	if (s->flags & (1 << NFTNL_SET_FLAGS))
 		mnl_attr_put_u32(nlh, NFTA_SET_FLAGS, htonl(s->set_flags));