From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 09:45:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6336C106564A; Sun, 15 Aug 2010 09:45:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id E801B8FC12; Sun, 15 Aug 2010 09:45:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id E81FF41C705; Sun, 15 Aug 2010 11:45:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id r501J+W53qtY; Sun, 15 Aug 2010 11:45:05 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id C76CF41C713; Sun, 15 Aug 2010 11:45:05 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 202914448EC; Sun, 15 Aug 2010 09:41:13 +0000 (UTC) Date: Sun, 15 Aug 2010 09:41:13 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Andre Oppermann In-Reply-To: <201008150930.o7F9UD2P054326@svn.freebsd.org> Message-ID: <20100815094057.F48418@maildrop.int.zabbadoz.net> References: <201008150930.o7F9UD2P054326@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211327 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Aug 2010 09:45:08 -0000 On Sun, 15 Aug 2010, Andre Oppermann wrote: > Author: andre > Date: Sun Aug 15 09:30:13 2010 > New Revision: 211327 > URL: http://svn.freebsd.org/changeset/base/211327 > > Log: > Add more logging points for failures in syncache_socket() to > report when a new socket couldn't be created because one of > in_pcbinshash(), in6_pcbconnect() or in_pcbconnect() failed. > > Logging is conditional on net.inet.tcp.log_debug being enabled. > > MFC after: 1 week > > Modified: > head/sys/netinet/tcp_syncache.c > > Modified: head/sys/netinet/tcp_syncache.c > ============================================================================== > --- head/sys/netinet/tcp_syncache.c Sun Aug 15 08:49:07 2010 (r211326) > +++ head/sys/netinet/tcp_syncache.c Sun Aug 15 09:30:13 2010 (r211327) > @@ -627,6 +627,7 @@ syncache_socket(struct syncache *sc, str > struct inpcb *inp = NULL; > struct socket *so; > struct tcpcb *tp; > + int error = 0; Is there any need to initialize here? > char *s; > > INP_INFO_WLOCK_ASSERT(&V_tcbinfo); > @@ -675,7 +676,7 @@ syncache_socket(struct syncache *sc, str > } > #endif > inp->inp_lport = sc->sc_inc.inc_lport; > - if (in_pcbinshash(inp) != 0) { > + if ((error = in_pcbinshash(inp)) != 0) { > /* > * Undo the assignments above if we failed to > * put the PCB on the hash lists. > @@ -687,6 +688,12 @@ syncache_socket(struct syncache *sc, str > #endif > inp->inp_laddr.s_addr = INADDR_ANY; > inp->inp_lport = 0; > + if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { > + log(LOG_DEBUG, "%s; %s: in_pcbinshash failed " > + "with error %i\n", > + s, __func__, error); > + free(s, M_TCPLOG); > + } > goto abort; > } > #ifdef IPSEC > @@ -721,9 +728,15 @@ syncache_socket(struct syncache *sc, str > laddr6 = inp->in6p_laddr; > if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) > inp->in6p_laddr = sc->sc_inc.inc6_laddr; > - if (in6_pcbconnect(inp, (struct sockaddr *)&sin6, > - thread0.td_ucred)) { > + if ((error = in6_pcbconnect(inp, (struct sockaddr *)&sin6, > + thread0.td_ucred)) != 0) { > inp->in6p_laddr = laddr6; > + if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { > + log(LOG_DEBUG, "%s; %s: in6_pcbconnect failed " > + "with error %i\n", > + s, __func__, error); > + free(s, M_TCPLOG); > + } > goto abort; > } > /* Override flowlabel from in6_pcbconnect. */ > @@ -750,9 +763,15 @@ syncache_socket(struct syncache *sc, str > laddr = inp->inp_laddr; > if (inp->inp_laddr.s_addr == INADDR_ANY) > inp->inp_laddr = sc->sc_inc.inc_laddr; > - if (in_pcbconnect(inp, (struct sockaddr *)&sin, > - thread0.td_ucred)) { > + if ((error = in_pcbconnect(inp, (struct sockaddr *)&sin, > + thread0.td_ucred)) != 0) { > inp->inp_laddr = laddr; > + if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { > + log(LOG_DEBUG, "%s; %s: in_pcbconnect failed " > + "with error %i\n", > + s, __func__, error); > + free(s, M_TCPLOG); > + } > goto abort; > } > } > -- Bjoern A. Zeeb This signature is about you not me.