diff options
author | Jeremy Sowden <jeremy@azazel.net> | 2025-05-26 18:19:03 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2025-06-01 14:12:47 +0200 |
commit | f699ba550c9f009924d8f5f59a190254938f9bec (patch) | |
tree | 76fe196beb718881d6b7d16c64d86f47189a5260 /util/printpkt.c | |
parent | c0f9d1950e0968688558c2abbaa41cffd03f19de (diff) |
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 <jeremy@azazel.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'util/printpkt.c')
-rw-r--r-- | util/printpkt.c | 7 |
1 files changed, 4 insertions, 3 deletions
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 <ulogd/conffile.h> #include <ulogd/printpkt.h> #include <netinet/if_ether.h> +#include <linux/netfilter.h> 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; } |