Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jul 2009 19:43:27 +0000 (UTC)
From:      Julian Elischer <julian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r195922 - in head/sys: kern netinet
Message-ID:  <200907281943.n6SJhRqv041613@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: julian
Date: Tue Jul 28 19:43:27 2009
New Revision: 195922
URL: http://svn.freebsd.org/changeset/base/195922

Log:
  Somewhere along the line accept sockets stopped honoring the
  FIB selected for them. Fix this.
  
  Reviewed by:	ambrisko
  Approved by:	re (kib)
  MFC after:	3 days

Modified:
  head/sys/kern/uipc_socket.c
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_syncache.c

Modified: head/sys/kern/uipc_socket.c
==============================================================================
--- head/sys/kern/uipc_socket.c	Tue Jul 28 17:16:54 2009	(r195921)
+++ head/sys/kern/uipc_socket.c	Tue Jul 28 19:43:27 2009	(r195922)
@@ -438,6 +438,7 @@ sonewconn(struct socket *head, int conns
 	so->so_options = head->so_options &~ SO_ACCEPTCONN;
 	so->so_linger = head->so_linger;
 	so->so_state = head->so_state | SS_NOFDREF;
+	so->so_fibnum = head->so_fibnum;
 	so->so_proto = head->so_proto;
 	so->so_cred = crhold(head->so_cred);
 #ifdef MAC

Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c	Tue Jul 28 17:16:54 2009	(r195921)
+++ head/sys/netinet/tcp_input.c	Tue Jul 28 19:43:27 2009	(r195922)
@@ -758,6 +758,7 @@ findpcb:
 		}
 		inc.inc_fport = th->th_sport;
 		inc.inc_lport = th->th_dport;
+		inc.inc_fibnum = so->so_fibnum;
 
 		/*
 		 * Check for an existing connection attempt in syncache if

Modified: head/sys/netinet/tcp_syncache.c
==============================================================================
--- head/sys/netinet/tcp_syncache.c	Tue Jul 28 17:16:54 2009	(r195921)
+++ head/sys/netinet/tcp_syncache.c	Tue Jul 28 19:43:27 2009	(r195922)
@@ -642,8 +642,7 @@ syncache_socket(struct syncache *sc, str
 #endif
 
 	inp = sotoinpcb(so);
-	inp->inp_inc.inc_fibnum = sc->sc_inc.inc_fibnum;
-	so->so_fibnum = sc->sc_inc.inc_fibnum;
+	inp->inp_inc.inc_fibnum = so->so_fibnum;
 	INP_WLOCK(inp);
 
 	/* Insert new socket into PCB hash list. */
@@ -1128,8 +1127,6 @@ _syncache_add(struct in_conninfo *inc, s
 	sc->sc_cred = cred;
 	cred = NULL;
 	sc->sc_ipopts = ipopts;
-	/* XXX-BZ this fib assignment is just useless. */
-	sc->sc_inc.inc_fibnum = inp->inp_inc.inc_fibnum;
 	bcopy(inc, &sc->sc_inc, sizeof(struct in_conninfo));
 #ifdef INET6
 	if (!(inc->inc_flags & INC_ISIPV6))
@@ -1403,6 +1400,7 @@ syncache_respond(struct syncache *sc)
 	} else
 		optlen = 0;
 
+	M_SETFIB(m, sc->sc_inc.inc_fibnum);
 #ifdef INET6
 	if (sc->sc_inc.inc_flags & INC_ISIPV6) {
 		th->th_sum = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907281943.n6SJhRqv041613>