Skip to contentSkip to conversation

vrf: check accept_source_route on the original netdevice

PATCH Superseded Stephen Suryaputra 1 participant 2 messages Mar 27, 2019

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vrf: check accept_source_route on the original netdevice

Configuration check to accept source route IP options should be made on the incoming netdevice when the skb->dev is an l3mdev master.

---
 net/ipv4/ip_input.c | 3 +++
 1 file changed, 3 insertions(+)
net/ipv4/ip_input.c +3 -0
index ecce2dc78f17..754176222ef6 100644
@@ -263,6 +263,9 @@ static inline bool ip_rcv_options(struct sk_buff *skb)
 	const struct iphdr *iph;
 	struct net_device *dev = skb->dev;
 
+	if (netif_is_l3_master(dev))
+		dev = __dev_get_by_index(dev_net(dev), IPCB(skb)->iif);
+
 	/* It looks as overkill, because not all
 	   IP options require packet mangling.
 	   But it is the easiest for now, especially taking
Signature · 1 line
2.17.1
#1 lore raw

Hit send too soon. There is another related problem that I think needs fixing.

Quoted 26 lines · Stephen Suryaputra

Configuration check to accept source route IP options should be made on the incoming netdevice when the skb->dev is an l3mdev master.

---
 net/ipv4/ip_input.c | 3 +++
 1 file changed, 3 insertions(+)
net/ipv4/ip_input.c +3 -1
index ecce2dc78f17..754176222ef6 100644
@@ -263,6 +263,9 @@ static inline bool ip_rcv_options(struct sk_buff *skb)
        const struct iphdr *iph;
        struct net_device *dev = skb->dev;
 
+       if (netif_is_l3_master(dev))
+               dev = __dev_get_by_index(dev_net(dev), IPCB(skb)->iif);
+
        /* It looks as overkill, because not all
           IP options require packet mangling.
           But it is the easiest for now, especially taking
--

2.17.1