summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2014-11-14 18:36:14 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2014-11-14 18:42:56 +0100
commitcf1e7d4a9799a74b7c367d27fb41d2264d665d92 (patch)
tree9d318e8b611b39f55ff0fcc3334cc065abcfeb2e /src
parent8fbb012f92ed491620b8f0ae312c8842aadffe06 (diff)
netlink: don't bug on unknown events
We will likely have new ones in the future, silently skip them. If the user wants to see them, it just needs to upgrade. This is currently causing us problems with kernels that deliver the generation counter event. term1# nft add table test term2# nft monitor nft: netlink.c:2063: netlink_events_cb: Assertion `0' failed. Aborted Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/netlink.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/netlink.c b/src/netlink.c
index 33e77ab0..23f38b03 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -2030,7 +2030,7 @@ static void netlink_events_cache_update(struct netlink_mon_handler *monh,
static int netlink_events_cb(const struct nlmsghdr *nlh, void *data)
{
int ret = MNL_CB_OK;
- int type = nlh->nlmsg_type & 0xFF;
+ uint16_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
struct netlink_mon_handler *monh = (struct netlink_mon_handler *)data;
netlink_events_cache_update(monh, nlh, type);
@@ -2059,9 +2059,6 @@ static int netlink_events_cb(const struct nlmsghdr *nlh, void *data)
case NFT_MSG_DELRULE:
ret = netlink_events_rule_cb(nlh, type, monh);
break;
- default:
- BUG("Unknow event received from netlink.\n");
- break;
}
return ret;