Commit 2f17becf authored by Stephen Suryaputra's avatar Stephen Suryaputra Committed by David S. Miller

vrf: check the original netdevice for generating redirect

Use the right device to determine if redirect should be sent especially
when using vrf. Same as well as when sending the redirect.
Signed-off-by: default avatarStephen Suryaputra <ssuryaextr@gmail.com>
Acked-by: default avatarDavid Ahern <dsahern@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cfed0a2c
...@@ -482,7 +482,8 @@ int ip6_forward(struct sk_buff *skb) ...@@ -482,7 +482,8 @@ int ip6_forward(struct sk_buff *skb)
send redirects to source routed frames. send redirects to source routed frames.
We don't send redirects to frames decapsulated from IPsec. We don't send redirects to frames decapsulated from IPsec.
*/ */
if (skb->dev == dst->dev && opt->srcrt == 0 && !skb_sec_path(skb)) { if (IP6CB(skb)->iif == dst->dev->ifindex &&
opt->srcrt == 0 && !skb_sec_path(skb)) {
struct in6_addr *target = NULL; struct in6_addr *target = NULL;
struct inet_peer *peer; struct inet_peer *peer;
struct rt6_info *rt; struct rt6_info *rt;
......
...@@ -1578,6 +1578,12 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target) ...@@ -1578,6 +1578,12 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
ops_data_buf[NDISC_OPS_REDIRECT_DATA_SPACE], *ops_data = NULL; ops_data_buf[NDISC_OPS_REDIRECT_DATA_SPACE], *ops_data = NULL;
bool ret; bool ret;
if (netif_is_l3_master(skb->dev)) {
dev = __dev_get_by_index(dev_net(skb->dev), IPCB(skb)->iif);
if (!dev)
return;
}
if (ipv6_get_lladdr(dev, &saddr_buf, IFA_F_TENTATIVE)) { if (ipv6_get_lladdr(dev, &saddr_buf, IFA_F_TENTATIVE)) {
ND_PRINTK(2, warn, "Redirect: no link-local address on %s\n", ND_PRINTK(2, warn, "Redirect: no link-local address on %s\n",
dev->name); dev->name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment