From f699ba550c9f009924d8f5f59a190254938f9bec Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Mon, 26 May 2025 18:19:03 +0100 Subject: Use `NFPROTO_*` constants for protocol families Netfilter has a set of `NFPROTO_*` constants for the protocol families that it supports, in part because it supports protocols and pseudo-protocols that do not have `PF_*` (and `AF_*`) constants. Currently, ulogd uses `AF_*` constants for protocol families, because it does not support any families which do not have `AF_*` constants. Switch to `NFPROTO_*` constants instead, so we can add ARP support later. In the IP2* filters, retain `AF_*` for address family variables. Remove a stray semicolon. Signed-off-by: Jeremy Sowden Signed-off-by: Florian Westphal --- util/printpkt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'util/printpkt.c') diff --git a/util/printpkt.c b/util/printpkt.c index 09a2194..2fecd50 100644 --- a/util/printpkt.c +++ b/util/printpkt.c @@ -35,6 +35,7 @@ #include #include #include +#include struct ulogd_key printpkt_keys[] = { [KEY_OOB_FAMILY] = { .name = "oob.family", }, @@ -457,13 +458,13 @@ int printpkt_print(struct ulogd_key *res, char *buf) buf_cur += sprintf(buf_cur, "MAC= "); switch (ikey_get_u8(&res[KEY_OOB_FAMILY])) { - case AF_INET: + case NFPROTO_IPV4: buf_cur += printpkt_ipv4(res, buf_cur); break; - case AF_INET6: + case NFPROTO_IPV6: buf_cur += printpkt_ipv6(res, buf_cur); break; - case AF_BRIDGE: + case NFPROTO_BRIDGE: buf_cur += printpkt_bridge(res, buf_cur); break; } -- cgit v1.2.3