Skip to content

Commit 1e19c4d

Browse files
dsaherndavem330
authored andcommitted
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>
1 parent a78e936 commit 1e19c4d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/vrf.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,9 @@ static struct sk_buff *vrf_ip_out(struct net_device *vrf_dev,
673673
struct sock *sk,
674674
struct sk_buff *skb)
675675
{
676-
/* don't divert multicast */
677-
if (ipv4_is_multicast(ip_hdr(skb)->daddr))
676+
/* don't divert multicast or local broadcast */
677+
if (ipv4_is_multicast(ip_hdr(skb)->daddr) ||
678+
ipv4_is_lbcast(ip_hdr(skb)->daddr))
678679
return skb;
679680

680681
if (qdisc_tx_is_default(vrf_dev))

0 commit comments

Comments
 (0)