summary refs log tree commit diff
path: root/drivers/net/vrf.c
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2018-01-24 19:37:37 -0800
committerDavid S. Miller <davem@davemloft.net>2018-01-25 21:51:03 -0500
commit1e19c4d689dc1e95bafd23ef68fbc0c6b9e05180 (patch)
tree39cfbe673f5af3396ae5794f2463d6c3475137f5 /drivers/net/vrf.c
parenta78e93661c5fd30b9e1dee464b2f62f966883ef7 (diff)
downloadlinux-1e19c4d689dc1e95bafd23ef68fbc0c6b9e05180.tar.gz
net: vrf: Add support for sends to local broadcast address
Sukumar reported that sends to the local broadcast address
(255.255.255.255) are broken. Check for the address in vrf driver
and do not redirect to the VRF device - similar to multicast
packets.

With this change sockets can use SO_BINDTODEVICE to specify an
egress interface and receive responses. Note: the egress interface
can not be a VRF device but needs to be the enslaved device.

https://bugzilla.kernel.org/show_bug.cgi?id=198521

Reported-by: Sukumar Gopalakrishnan <sukumarg1973@gmail.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vrf.c')
-rw-r--r--drivers/net/vrf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index feb1b2e15c2e..139c61c8244a 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -673,8 +673,9 @@ static struct sk_buff *vrf_ip_out(struct net_device *vrf_dev,
 				  struct sock *sk,
 				  struct sk_buff *skb)
 {
-	/* don't divert multicast */
-	if (ipv4_is_multicast(ip_hdr(skb)->daddr))
+	/* don't divert multicast or local broadcast */
+	if (ipv4_is_multicast(ip_hdr(skb)->daddr) ||
+	    ipv4_is_lbcast(ip_hdr(skb)->daddr))
 		return skb;
 
 	if (qdisc_tx_is_default(vrf_dev))