summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2016-12-14 01:12:43 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2016-12-16 20:20:18 +0100
commit68de70f2b3fc64b7016da48530946165c9986780 (patch)
tree673fa9accd34c9600a078e20f66cbc78f0e9bf57
parent1fddd03cf36122e5ff669e5083ed7af6408cacec (diff)
netlink_linearize: fix IPv6 layer 4 checksum mangling
In IPv6 there is no checksum field. We always have to trigger layer 4 checksum mangling if any of the layer 3 pseudoheader fields are updated. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--src/netlink_linearize.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/netlink_linearize.c b/src/netlink_linearize.c
index 4a0001a4..0915038f 100644
--- a/src/netlink_linearize.c
+++ b/src/netlink_linearize.c
@@ -806,12 +806,11 @@ static void netlink_gen_payload_stmt(struct netlink_linearize_ctx *ctx,
NFT_PAYLOAD_CSUM_INET);
nftnl_expr_set_u32(nle, NFTNL_EXPR_PAYLOAD_CSUM_OFFSET,
csum_off / BITS_PER_BYTE);
-
- if (expr->payload.base == PROTO_BASE_NETWORK_HDR &&
- payload_needs_l4csum_update_pseudohdr(expr, desc))
- nftnl_expr_set_u32(nle, NFTNL_EXPR_PAYLOAD_FLAGS,
- NFT_PAYLOAD_L4CSUM_PSEUDOHDR);
}
+ if (expr->payload.base == PROTO_BASE_NETWORK_HDR &&
+ payload_needs_l4csum_update_pseudohdr(expr, desc))
+ nftnl_expr_set_u32(nle, NFTNL_EXPR_PAYLOAD_FLAGS,
+ NFT_PAYLOAD_L4CSUM_PSEUDOHDR);
nftnl_rule_add_expr(ctx->nlr, nle);
}