mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Remove restrictions on the sending address
It is quite legal to send from the ANY address (it is required for DHCP). I can't figure out why the broadcast address was included here, so removing that as well. PiperOrigin-RevId: 275541954
This commit is contained in:
committed by
gVisor bot
parent
4c7f849b25
commit
4e6f3a0c71
@@ -47,10 +47,6 @@ func TestExcludeBroadcast(t *testing.T) {
|
||||
t.Fatalf("CreateNIC failed: %v", err)
|
||||
}
|
||||
|
||||
if err := s.AddAddress(1, ipv4.ProtocolNumber, header.IPv4Any); err != nil {
|
||||
t.Fatalf("AddAddress failed: %v", err)
|
||||
}
|
||||
|
||||
s.SetRouteTable([]tcpip.Route{{
|
||||
Destination: header.IPv4EmptySubnet,
|
||||
NIC: 1,
|
||||
|
||||
@@ -173,11 +173,6 @@ func (n *NIC) primaryEndpoint(protocol tcpip.NetworkProtocolNumber) *referencedN
|
||||
|
||||
for e := list.Front(); e != nil; e = e.Next() {
|
||||
r := e.(*referencedNetworkEndpoint)
|
||||
// TODO(crawshaw): allow broadcast address when SO_BROADCAST is set.
|
||||
switch r.ep.ID().LocalAddress {
|
||||
case header.IPv4Broadcast, header.IPv4Any:
|
||||
continue
|
||||
}
|
||||
if r.isValidForOutgoing() && r.tryIncRef() {
|
||||
return r
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user