kernel: 5.10: backport QCA83x PHY resume fix, DAC amplitude preferred master, debug...
[openwrt/openwrt.git] / target / linux / generic / backport-5.10 / 610-v5.13-29-netfilter-flowtable-support-for-FLOW_ACTION_PPPOE_PU.patch
1 From: Pablo Neira Ayuso <pablo@netfilter.org>
2 Date: Wed, 24 Mar 2021 02:30:50 +0100
3 Subject: [PATCH] netfilter: flowtable: support for
4 FLOW_ACTION_PPPOE_PUSH
5
6 Add a PPPoE push action if layer 2 protocol is ETH_P_PPP_SES to add
7 PPPoE flowtable hardware offload support.
8
9 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
10 ---
11
12 --- a/net/netfilter/nf_flow_table_offload.c
13 +++ b/net/netfilter/nf_flow_table_offload.c
14 @@ -600,9 +600,18 @@ nf_flow_rule_route_common(struct net *ne
15 continue;
16
17 entry = flow_action_entry_next(flow_rule);
18 - entry->id = FLOW_ACTION_VLAN_PUSH;
19 - entry->vlan.vid = other_tuple->encap[i].id;
20 - entry->vlan.proto = other_tuple->encap[i].proto;
21 +
22 + switch (other_tuple->encap[i].proto) {
23 + case htons(ETH_P_PPP_SES):
24 + entry->id = FLOW_ACTION_PPPOE_PUSH;
25 + entry->pppoe.sid = other_tuple->encap[i].id;
26 + break;
27 + case htons(ETH_P_8021Q):
28 + entry->id = FLOW_ACTION_VLAN_PUSH;
29 + entry->vlan.vid = other_tuple->encap[i].id;
30 + entry->vlan.proto = other_tuple->encap[i].proto;
31 + break;
32 + }
33 }
34
35 return 0;