diff options
author | Patrick McHardy <kaber@trash.net> | 2016-04-24 11:22:30 +0100 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2016-04-24 11:22:30 +0100 |
commit | 20b1131c07acd2fc71803be592430f0e06c4090e (patch) | |
tree | dc7c984f5bf2c2b29c2011825fd20805a0fd4166 /src/netlink_delinearize.c | |
parent | e20eac092725c982387181f3df557877b02eb345 (diff) |
payload: fix stacked headers protocol context tracking
The code contains multiple scattered around fragments to fiddle with the
protocol contexts to work around the fact that stacked headers update the
context for the incorrect layer.
Fix this by updating the correct layer in payload_expr_pctx_update() and
also take care of offset adjustments there and only there. Remove all
manual protocol context fiddling and change protocol context debugging to
also print the offset for stacked headers.
All previously successful testcases pass.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src/netlink_delinearize.c')
-rw-r--r-- | src/netlink_delinearize.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/netlink_delinearize.c b/src/netlink_delinearize.c index ca1c6e60..ee4cf12b 100644 --- a/src/netlink_delinearize.c +++ b/src/netlink_delinearize.c @@ -1077,13 +1077,10 @@ static void payload_dependency_save(struct rule_pp_ctx *ctx, unsigned int base, stacked_header = next && next->base == base; } - if (stacked_header) { - ctx->pctx.protocol[base].desc = next; - ctx->pctx.protocol[base].offset += desc->length; + if (stacked_header) payload_dependency_store(ctx, nstmt, base - 1); - } else { + else payload_dependency_store(ctx, nstmt, base); - } } static void payload_match_expand(struct rule_pp_ctx *ctx, |