Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/netinet/udp_usrreq.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/netinet/udp_usrreq.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.99 retrieving revision 1.104 diff -u -p -r1.99 -r1.104 --- src/sys/netinet/udp_usrreq.c 2003/05/14 06:47:37 1.99 +++ src/sys/netinet/udp_usrreq.c 2003/08/07 16:33:20 1.104 @@ -1,4 +1,4 @@ -/* $NetBSD: udp_usrreq.c,v 1.99 2003/05/14 06:47:37 itojun Exp $ */ +/* $NetBSD: udp_usrreq.c,v 1.104 2003/08/07 16:33:20 agc Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -41,11 +41,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -65,12 +61,13 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.99 2003/05/14 06:47:37 itojun Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.104 2003/08/07 16:33:20 agc Exp $"); #include "opt_inet.h" #include "opt_ipsec.h" #include "opt_inet_csum.h" #include "opt_ipkdb.h" +#include "opt_mbuftrace.h" #include #include @@ -1007,6 +1004,11 @@ udp_usrreq(so, req, m, nam, control, p) so->so_state &= ~SS_ISCONNECTED; /* XXX */ in_pcbdisconnect(inp); inp->inp_laddr = zeroin_addr; /* XXX */ + if (inp->inp_ia != NULL) { + LIST_REMOVE(inp, inp_ialink); + IFAFREE(&inp->inp_ia->ia_ifa); + inp->inp_ia = NULL; + } in_pcbstate(inp, INP_BOUND); /* XXX */ break; @@ -1035,11 +1037,8 @@ udp_usrreq(so, req, m, nam, control, p) goto die; } error = in_pcbconnect(inp, nam); - if (error) { - die: - m_freem(m); - break; - } + if (error) + goto die; } else { if ((so->so_state & SS_ISCONNECTED) == 0) { error = ENOTCONN; @@ -1047,11 +1046,20 @@ udp_usrreq(so, req, m, nam, control, p) } } error = udp_output(m, inp); + m = NULL; if (nam) { in_pcbdisconnect(inp); inp->inp_laddr = laddr; /* XXX */ in_pcbstate(inp, INP_BOUND); /* XXX */ } + die: + if (inp->inp_ia != NULL && in_nullhost(inp->inp_laddr)) { + LIST_REMOVE(inp, inp_ialink); + IFAFREE(&inp->inp_ia->ia_ifa); + inp->inp_ia = NULL; + } + if (m) + m_freem(m); } break;