summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-filter/nftables/files/0003-payload-split-ll-proto-dependency-into-helper.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-filter/nftables/files/0003-payload-split-ll-proto-dependency-into-helper.patch')
-rw-r--r--meta-networking/recipes-filter/nftables/files/0003-payload-split-ll-proto-dependency-into-helper.patch62
1 files changed, 0 insertions, 62 deletions
diff --git a/meta-networking/recipes-filter/nftables/files/0003-payload-split-ll-proto-dependency-into-helper.patch b/meta-networking/recipes-filter/nftables/files/0003-payload-split-ll-proto-dependency-into-helper.patch
deleted file mode 100644
index 50cac300e..000000000
--- a/meta-networking/recipes-filter/nftables/files/0003-payload-split-ll-proto-dependency-into-helper.patch
+++ /dev/null
@@ -1,62 +0,0 @@
1From 8d8cfe5ad6ca460a5262fb15fdbef3601058c784 Mon Sep 17 00:00:00 2001
2From: Florian Westphal <fw@strlen.de>
3Date: Thu, 18 May 2017 13:30:54 +0200
4Subject: [PATCH 1/4] payload: split ll proto dependency into helper
5
6will be re-used in folloup patch for icmp/icmpv6 depenency
7handling.
8
9Signed-off-by: Florian Westphal <fw@strlen.de>
10---
11Upstream-Status: Backport
12Signed-off-by: André Draszik <adraszik@tycoint.com>
13 src/payload.c | 29 ++++++++++++++++++-----------
14 1 file changed, 18 insertions(+), 11 deletions(-)
15
16diff --git a/src/payload.c b/src/payload.c
17index 55128fe..31e5a02 100644
18--- a/src/payload.c
19+++ b/src/payload.c
20@@ -224,21 +224,28 @@ static int payload_add_dependency(struct eval_ctx *ctx,
21 }
22
23 static const struct proto_desc *
24+payload_get_get_ll_hdr(const struct eval_ctx *ctx)
25+{
26+ switch (ctx->pctx.family) {
27+ case NFPROTO_INET:
28+ return &proto_inet;
29+ case NFPROTO_BRIDGE:
30+ return &proto_eth;
31+ case NFPROTO_NETDEV:
32+ return &proto_netdev;
33+ default:
34+ break;
35+ }
36+
37+ return NULL;
38+}
39+
40+static const struct proto_desc *
41 payload_gen_special_dependency(struct eval_ctx *ctx, const struct expr *expr)
42 {
43 switch (expr->payload.base) {
44 case PROTO_BASE_LL_HDR:
45- switch (ctx->pctx.family) {
46- case NFPROTO_INET:
47- return &proto_inet;
48- case NFPROTO_BRIDGE:
49- return &proto_eth;
50- case NFPROTO_NETDEV:
51- return &proto_netdev;
52- default:
53- break;
54- }
55- break;
56+ return payload_get_get_ll_hdr(ctx);
57 case PROTO_BASE_TRANSPORT_HDR:
58 if (expr->payload.desc == &proto_icmp)
59 return &proto_ip;
60--
612.11.0
62