Fix a bug in the recent connectionless commit. When sending a UDP packet
authorMatthew Dillon <dillon@dragonflybsd.org>
Wed, 17 Mar 2004 02:27:59 +0000 (02:27 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Wed, 17 Mar 2004 02:27:59 +0000 (02:27 +0000)
commitb5f1acc295918c9ab326d6ac8cb32f381ff580d0
tree33551042122dcaa6817930ab7c8b9fcb23757507
parente81b1906259255f85420eb73aaab2a47660c4f33
Fix a bug in the recent connectionless commit.  When sending a UDP packet
over a connected socket but with a source address of INADDR_ANY, udp_output()
was calling in_pcbladdr() with a NULL sockaddr pointer, causing a null
pointer panic.

Construct a temporary sockaddr_in to pass to in_pcbladdr() with the foreign
address instead.  in_pcbladdr() takes an address and returns the interface
source IP address that best characterizes the interface the packet will be
sent out of.
sys/netinet/udp_usrreq.c