summaryrefslogtreecommitdiff
path: root/net/sched
diff options
context:
space:
mode:
authorMartin Varghese <martin.varghese@nokia.com>2019-12-05 03:27:22 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-18 18:08:56 +0300
commitcd477d06d22d8b6d058962043060785c76819446 (patch)
tree82854b55ca8f618196d8fdbf62214acf4ed4e977 /net/sched
parent10fec3e5660b40839c0109e45569909ec5e33916 (diff)
downloadlinux-cd477d06d22d8b6d058962043060785c76819446.tar.xz
net: Fixed updating of ethertype in skb_mpls_push()
[ Upstream commit d04ac224b1688f005a84f764cfe29844f8e9da08 ] The skb_mpls_push was not updating ethertype of an ethernet packet if the packet was originally received from a non ARPHRD_ETHER device. In the below OVS data path flow, since the device corresponding to port 7 is an l3 device (ARPHRD_NONE) the skb_mpls_push function does not update the ethertype of the packet even though the previous push_eth action had added an ethernet header to the packet. recirc_id(0),in_port(7),eth_type(0x0800),ipv4(tos=0/0xfc,ttl=64,frag=no), actions:push_eth(src=00:00:00:00:00:00,dst=00:00:00:00:00:00), push_mpls(label=13,tc=0,ttl=64,bos=1,eth_type=0x8847),4 Fixes: 8822e270d697 ("net: core: move push MPLS functionality from OvS to core helper") Signed-off-by: Martin Varghese <martin.varghese@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/act_mpls.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sched/act_mpls.c b/net/sched/act_mpls.c
index bf74a6c4990c..db570d2bd0e0 100644
--- a/net/sched/act_mpls.c
+++ b/net/sched/act_mpls.c
@@ -83,7 +83,8 @@ static int tcf_mpls_act(struct sk_buff *skb, const struct tc_action *a,
break;
case TCA_MPLS_ACT_PUSH:
new_lse = tcf_mpls_get_lse(NULL, p, !eth_p_mpls(skb->protocol));
- if (skb_mpls_push(skb, new_lse, p->tcfm_proto, mac_len))
+ if (skb_mpls_push(skb, new_lse, p->tcfm_proto, mac_len,
+ skb->dev && skb->dev->type == ARPHRD_ETHER))
goto drop;
break;
case TCA_MPLS_ACT_MODIFY: