kernel: update 5.10 flow offload patches
[openwrt/staging/rmilecki.git] / target / linux / generic / pending-5.10 / 640-20-netfilter-flowtable-support-for-FLOW_ACTION_PPPOE_PU.patch
1 From: Pablo Neira Ayuso <pablo@netfilter.org>
2 Date: Tue, 2 Mar 2021 01:01:50 +0100
3 Subject: [PATCH] netfilter: flowtable: support for
4 FLOW_ACTION_PPPOE_PUSH
5
6 ---
7
8 --- a/net/netfilter/nf_flow_table_offload.c
9 +++ b/net/netfilter/nf_flow_table_offload.c
10 @@ -598,9 +598,18 @@ nf_flow_rule_route_common(struct net *ne
11 continue;
12
13 entry = flow_action_entry_next(flow_rule);
14 - entry->id = FLOW_ACTION_VLAN_PUSH;
15 - entry->vlan.vid = other_tuple->encap[i].id;
16 - entry->vlan.proto = other_tuple->encap[i].proto;
17 +
18 + switch (other_tuple->encap[i].proto) {
19 + case htons(ETH_P_PPP_SES):
20 + entry->id = FLOW_ACTION_PPPOE_PUSH;
21 + entry->pppoe.sid = other_tuple->encap[i].id;
22 + break;
23 + case htons(ETH_P_8021Q):
24 + entry->id = FLOW_ACTION_VLAN_PUSH;
25 + entry->vlan.vid = other_tuple->encap[i].id;
26 + entry->vlan.proto = other_tuple->encap[i].proto;
27 + break;
28 + }
29 }
30
31 return 0;