From: Patrick McHardy Date: Fri, 18 Jan 2008 16:55:54 +0000 (+0100) Subject: [LIBNL]: nfnetlink_log: only set hwproto if not zero X-Git-Tag: libnl2_0~144 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5618ea8f5a1cf417fec434788b4b14cc7fcbe246;p=libnl [LIBNL]: nfnetlink_log: only set hwproto if not zero 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 --- diff --git a/lib/netfilter/log.c b/lib/netfilter/log.c index a6bf3d5..a900927 100644 --- a/lib/netfilter/log.c +++ b/lib/netfilter/log.c @@ -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); }