]> granicus.if.org Git - libnl/commitdiff
[LIBNL]: nfnetlink_log: only set hwproto if not zero
authorPatrick McHardy <kaber@trash.net>
Fri, 18 Jan 2008 16:55:54 +0000 (17:55 +0100)
committerThomas Graf <tgr@deb.localdomain>
Thu, 7 Feb 2008 12:01:12 +0000 (13:01 +0100)
The hwproto doesn't have its own attribute and is also present when
not set. Don't set the attribute if its value is zero.

Signed-off-by: Patrick McHardy <kaber@trash.net>
lib/netfilter/log.c

index a6bf3d5a942c4d781cc06abc68be0cd58c868075..a9009273e280244d4b38c0ea6a547062201e371b 100644 (file)
@@ -86,7 +86,8 @@ struct nfnl_log *nfnlmsg_log_parse(struct nlmsghdr *nlh)
        if (attr) {
                struct nfulnl_msg_packet_hdr *hdr = nla_data(attr);
 
-               nfnl_log_set_hwproto(log, hdr->hw_protocol);
+               if (hdr->hw_protocol)
+                       nfnl_log_set_hwproto(log, hdr->hw_protocol);
                nfnl_log_set_hook(log, hdr->hook);
        }