From: Liping Zhang Date: Fri, 2 Sep 2016 12:51:26 +0000 (+0800) Subject: trace: use get_u32 to parse NFPROTO and POLICY attribute X-Git-Tag: libnftnl-1.0.7~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c70451db74961f33c21291f617eff1026d71daec;p=thirdparty%2Flibnftnl.git trace: use get_u32 to parse NFPROTO and POLICY attribute NFTA_TRACE_NFPROTO and NFTA_TRACE_POLICY attribute is 32-bit value, so we should use mnl_attr_get_u32 and htonl here. Signed-off-by: Liping Zhang Signed-off-by: Florian Westphal --- diff --git a/src/trace.c b/src/trace.c index 2b3388d9..bd05d3c5 100644 --- a/src/trace.c +++ b/src/trace.c @@ -408,12 +408,12 @@ int nftnl_trace_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_trace *t) t->flags |= (1 << NFTNL_TRACE_TRANSPORT_HEADER); if (tb[NFTA_TRACE_NFPROTO]) { - t->nfproto = ntohs(mnl_attr_get_u16(tb[NFTA_TRACE_NFPROTO])); + t->nfproto = ntohl(mnl_attr_get_u32(tb[NFTA_TRACE_NFPROTO])); t->flags |= (1 << NFTNL_TRACE_NFPROTO); } if (tb[NFTA_TRACE_POLICY]) { - t->policy = ntohs(mnl_attr_get_u16(tb[NFTA_TRACE_POLICY])); + t->policy = ntohl(mnl_attr_get_u32(tb[NFTA_TRACE_POLICY])); t->flags |= (1 << NFTNL_TRACE_POLICY); }