Although the value of AF_INET and NFPROTO_IPV4 is the same, the use of
AF_INET was misleading when checking the proto family.
Same with AF_INET6.
Signed-off-by: Máté Eckl <ecklm94@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
static int nat_evaluate_family(struct eval_ctx *ctx, struct stmt *stmt)
{
switch (ctx->pctx.family) {
- case AF_INET:
- case AF_INET6:
+ case NFPROTO_IPV4:
+ case NFPROTO_IPV6:
return 0;
default:
return stmt_error(ctx, stmt,
const struct datatype *dtype;
unsigned int len;
- if (pctx->family == AF_INET) {
+ if (pctx->family == NFPROTO_IPV4) {
dtype = &ipaddr_type;
len = 4 * BITS_PER_BYTE;
} else {
goto out_err;
}
- if (family == AF_INET)
+ if (family == NFPROTO_IPV4)
expr_set_type(addr, &ipaddr_type, BYTEORDER_BIG_ENDIAN);
else
expr_set_type(addr, &ip6addr_type,
goto out_err;
}
- if (family == AF_INET)
+ if (family == NFPROTO_IPV4)
expr_set_type(addr, &ipaddr_type, BYTEORDER_BIG_ENDIAN);
else
expr_set_type(addr, &ip6addr_type,