ed7346a61a39d2bd5b7442ee03f894ccd475f5e5
[openwrt/staging/aparcar.git] /
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;