summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/stack/nud.go
diff options
context:
space:
mode:
authorSam Balana <sbalana@google.com>2020-08-07 15:05:13 -0700
committergVisor bot <gvisor-bot@google.com>2020-08-07 15:07:33 -0700
commit94447aeab3d20400680f624e4b84e7b6fc0aae0b (patch)
treea5bf484d780ae3ce8b66406ebf1f6dba20d9c2f4 /pkg/tcpip/stack/nud.go
parent7b9bfc0ce094b0fd0cb3beec665a7b64c4ec552e (diff)
Fix panic during Address Resolution of neighbor entry created by NS
When a Neighbor Solicitation is received, a neighbor entry is created with the remote host's link layer address, but without a link layer address resolver. If the host decides to send a packet addressed to the IP address of that neighbor entry, Address Resolution starts with a nil pointer to the link layer address resolver. This causes the netstack to panic and crash. This change ensures that when a packet is sent in that situation, the link layer address resolver will be set before Address Resolution begins. Tests: pkg/tcpip/stack:stack_test + TestEntryUnknownToStaleToProbeToReachable - TestNeighborCacheEntryNoLinkAddress Updates #1889 Updates #1894 Updates #1895 Updates #1947 Updates #1948 Updates #1949 Updates #1950 PiperOrigin-RevId: 325516471
Diffstat (limited to 'pkg/tcpip/stack/nud.go')
-rw-r--r--pkg/tcpip/stack/nud.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/tcpip/stack/nud.go b/pkg/tcpip/stack/nud.go
index f848d50ad..e1ec15487 100644
--- a/pkg/tcpip/stack/nud.go
+++ b/pkg/tcpip/stack/nud.go
@@ -177,7 +177,7 @@ type NUDHandler interface {
// Neighbor Solicitation for ARP or NDP, respectively). Validation of the
// probe needs to be performed before calling this function since the
// Neighbor Cache doesn't have access to view the NIC's assigned addresses.
- HandleProbe(remoteAddr, localAddr tcpip.Address, protocol tcpip.NetworkProtocolNumber, remoteLinkAddr tcpip.LinkAddress)
+ HandleProbe(remoteAddr, localAddr tcpip.Address, protocol tcpip.NetworkProtocolNumber, remoteLinkAddr tcpip.LinkAddress, linkRes LinkAddressResolver)
// HandleConfirmation processes an incoming neighbor confirmation (e.g. ARP
// reply or Neighbor Advertisement for ARP or NDP, respectively).