gvisor/pkg/tcpip
Ghanan Gowripalan d5787f628c Don't bind loopback to all IPs in an IPv6 subnet
An earlier change considered the loopback bound to all addresses in an
assigned subnet. This should have only be done for IPv4 to maintain
compatability with Linux:

```
$ ip addr show dev lo
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group ...
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
$ ping 2001:db8::1
PING 2001:db8::1(2001:db8::1) 56 data bytes
^C
--- 2001:db8::1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3062ms

$ ping 2001:db8::2
PING 2001:db8::2(2001:db8::2) 56 data bytes
^C
--- 2001:db8::2 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2030ms

$ sudo ip addr add 2001:db8::1/64 dev lo
$ ping 2001:db8::1
PING 2001:db8::1(2001:db8::1) 56 data bytes
64 bytes from 2001:db8::1: icmp_seq=1 ttl=64 time=0.055 ms
64 bytes from 2001:db8::1: icmp_seq=2 ttl=64 time=0.074 ms
64 bytes from 2001:db8::1: icmp_seq=3 ttl=64 time=0.073 ms
64 bytes from 2001:db8::1: icmp_seq=4 ttl=64 time=0.071 ms
^C
--- 2001:db8::1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3075ms
rtt min/avg/max/mdev = 0.055/0.068/0.074/0.007 ms
$ ping 2001:db8::2
PING 2001:db8::2(2001:db8::2) 56 data bytes
From 2001:db8::1 icmp_seq=1 Destination unreachable: No route
From 2001:db8::1 icmp_seq=2 Destination unreachable: No route
From 2001:db8::1 icmp_seq=3 Destination unreachable: No route
From 2001:db8::1 icmp_seq=4 Destination unreachable: No route
^C
--- 2001:db8::2 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3070ms
```

Test: integration_test.TestLoopbackAcceptAllInSubnet
PiperOrigin-RevId: 329011566
2020-08-28 14:39:30 -07:00
..
adapters/gonet
buffer Migrate to PacketHeader API for PacketBuffer. 2020-08-13 13:08:57 -07:00
checker Give the ICMP Code its own type 2020-08-14 02:07:36 -07:00
hash/jenkins
header Give the ICMP Code its own type 2020-08-14 02:07:36 -07:00
link Use new reference count utility throughout gvisor. 2020-08-25 21:04:04 -07:00
network Improve type safety for network protocol options 2020-08-28 11:50:17 -07:00
ports
sample
seqnum Don't accept segments outside the receive window 2020-04-19 22:16:14 -07:00
stack Don't bind loopback to all IPs in an IPv6 subnet 2020-08-28 14:39:30 -07:00
tests/integration Don't bind loopback to all IPs in an IPv6 subnet 2020-08-28 14:39:30 -07:00
transport
BUILD
tcpip.go Improve type safety for network protocol options 2020-08-28 11:50:17 -07:00
tcpip_test.go
time.s
time_unsafe.go Bump build constraints to 1.17 2020-08-24 12:58:39 -07:00
timer.go
timer_test.go