summaryrefslogtreecommitdiffstats
path: root/net/can
diff options
context:
space:
mode:
Diffstat (limited to 'net/can')
-rw-r--r--net/can/gw.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/can/gw.c b/net/can/gw.c
index 574dda78eb0f..37a3efb7cc9d 100644
--- a/net/can/gw.c
+++ b/net/can/gw.c
@@ -52,6 +52,7 @@
#include <linux/skbuff.h>
#include <linux/can.h>
#include <linux/can/core.h>
+#include <linux/can/skb.h>
#include <linux/can/gw.h>
#include <net/rtnetlink.h>
#include <net/net_namespace.h>
@@ -347,6 +348,13 @@ static void can_can_gw_rcv(struct sk_buff *skb, void *data)
return;
}
+ /* is sending the skb back to the incoming interface not allowed? */
+ if (!(gwj->flags & CGW_FLAGS_CAN_IIF_TX_OK) &&
+ skb_headroom(skb) == sizeof(struct can_skb_priv) &&
+ (((struct can_skb_priv *)(skb->head))->ifindex ==
+ gwj->dst.dev->ifindex))
+ return;
+
/*
* clone the given skb, which has not been done in can_rcv()
*