dect
/
libnl
Archived
13
0
Fork 0

[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:
Patrick McHardy 2008-01-18 17:55:54 +01:00 committed by Thomas Graf
parent e72cb033f2
commit 5618ea8f5a
1 changed files with 2 additions and 1 deletions

View 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);
}