]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/sched/act_mpls.c
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
[linux.git] / net / sched / act_mpls.c
index 325eddcc6621e37ec03e4b9c929c0a2cc86603a4..be3f215cd0277b1a32e8da8634b5edd2f32b25af 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
 /* Copyright (C) 2019 Netronome Systems, Inc. */
 
+#include <linux/if_arp.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -76,12 +77,14 @@ static int tcf_mpls_act(struct sk_buff *skb, const struct tc_action *a,
 
        switch (p->tcfm_action) {
        case TCA_MPLS_ACT_POP:
-               if (skb_mpls_pop(skb, p->tcfm_proto, mac_len))
+               if (skb_mpls_pop(skb, p->tcfm_proto, mac_len,
+                                skb->dev && skb->dev->type == ARPHRD_ETHER))
                        goto drop;
                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: