diff options
author | Stephen Suryaputra <ssuryaextr@gmail.com> | 2019-04-01 09:17:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-01 13:44:58 -0400 |
commit | 8c83f2df9c6578ea4c5b940d8238ad8a41b87e9e (patch) | |
tree | 25b10b6f99295706111c3cbd972cac15a7e8ced1 /net/ipv4/ip_options.c | |
parent | 8c1074f690bca6c6c8d79fc4a5752635cd0bfbe0 (diff) |
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. The route
lookup for the source route next hop also needs the incoming netdev.
v2->v3:
- Simplify by passing the original netdevice down the stack (per David
Ahern).
Signed-off-by: Stephen Suryaputra <ssuryaextr@gmail.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_options.c')
-rw-r--r-- | net/ipv4/ip_options.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c index 32a35043c9f5..3db31bb9df50 100644 --- a/net/ipv4/ip_options.c +++ b/net/ipv4/ip_options.c | |||
@@ -612,7 +612,7 @@ void ip_forward_options(struct sk_buff *skb) | |||
612 | } | 612 | } |
613 | } | 613 | } |
614 | 614 | ||
615 | int ip_options_rcv_srr(struct sk_buff *skb) | 615 | int ip_options_rcv_srr(struct sk_buff *skb, struct net_device *dev) |
616 | { | 616 | { |
617 | struct ip_options *opt = &(IPCB(skb)->opt); | 617 | struct ip_options *opt = &(IPCB(skb)->opt); |
618 | int srrspace, srrptr; | 618 | int srrspace, srrptr; |
@@ -647,7 +647,7 @@ int ip_options_rcv_srr(struct sk_buff *skb) | |||
647 | 647 | ||
648 | orefdst = skb->_skb_refdst; | 648 | orefdst = skb->_skb_refdst; |
649 | skb_dst_set(skb, NULL); | 649 | skb_dst_set(skb, NULL); |
650 | err = ip_route_input(skb, nexthop, iph->saddr, iph->tos, skb->dev); | 650 | err = ip_route_input(skb, nexthop, iph->saddr, iph->tos, dev); |
651 | rt2 = skb_rtable(skb); | 651 | rt2 = skb_rtable(skb); |
652 | if (err || (rt2->rt_type != RTN_UNICAST && rt2->rt_type != RTN_LOCAL)) { | 652 | if (err || (rt2->rt_type != RTN_UNICAST && rt2->rt_type != RTN_LOCAL)) { |
653 | skb_dst_drop(skb); | 653 | skb_dst_drop(skb); |