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;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to