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
This commit is contained in:
Julian Elischer 2009-07-28 19:43:27 +00:00
parent 9fca4f79c7
commit 7973fba3a4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=195922
3 changed files with 4 additions and 4 deletions

View File

@ -438,6 +438,7 @@ sonewconn(struct socket *head, int connstatus)
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

View File

@ -758,6 +758,7 @@ tcp_input(struct mbuf *m, int off0)
}
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

View File

@ -642,8 +642,7 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
#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, struct tcpopt *to, struct tcphdr *th,
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;