Socket destroy delayed due to pending arp request

Bjorn Ekwall (rmenon@tisl.ukans.edu)
Sun, 17 Mar 1996 18:52:07 -0600 (CST)


Hi,

I can reproduce the "Socket destroy delayed" message reliably on my
machine (kernel 1.3.75, SMC Ultra, P90 24M).

If I ping a non existent machine on my local network and kill the
ping (CTRL-C) immediately I get this message (actually two of them).
Once both messages have come the arp cache will contain an entry for
that address (and any more pings will fail harmlessly). Delete this
entry and repeat and the problem message comes again.

Here's what looks like is happening:

The initial udp packet can't go out because there is no arp entry for
the destination address. The memory for the packet is assigned to the
socket (sk->wmem_alloc) and an arp request is sent out. At this point
the socket is closed but it is'nt destroyed because wmem_alloc is non
zero, so the message "Socket destroy delayed". It finally gets destroyed
when the arp times out and arp_release_entry is called (which calls
dev_kfree_skb to free all buffers waiting for that entry). Once the arp
entry is created any more packets to that address are free'd inside
arp_find at line 1257 (dev_kfree_skb() called because entry->last_update == 0),
then when the socket is closed no packets are waiting.

I don't know if this is the only reason the message comes, but hope this
helps.

-- 
Raghavan ============ rmenon@tisl.ukans.edu or rmenon@engr.ukans.edu