[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 <kaber@trash.net>
This commit is contained in:
parent
e72cb033f2
commit
5618ea8f5a
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue