Subject: Re: UDP and ICMP unreach
To: Jorgen Lundman <>
From: Greg Troxel <>
List: netbsd-users
Date: 02/15/2005 10:17:21
Setting the current code aside, it would seem to be that in order to
deliver unreachables properly the kernel would have to match the
incoming ICMP to the socket used to send the packet.  With connected
sockets, the addresses and port numbers in the unreachable can be used
to find the PCB.  With unconnected sockets that are bound, this could
perhaps still be done, matching on the local values only.

It also might be reasonable to keep a cache of recently transmitted
src,dst,sport,dport pairs so unreachables can be matched to the socket
that sent the packet.  This is likely to be viewed as unreasonably
expensive for most situations.

Another issue is matching up the unreachable with the transmitted
packet in the application.  With a connected socket, the destination
always matches so there is generally no need to match the particular

        Greg Troxel <>