summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2009-07-28 19:43:27 +0000
committerjulian <julian@FreeBSD.org>2009-07-28 19:43:27 +0000
commitf22b416ddb62260d0b81c89a5d5d330c90b92170 (patch)
treed4546cf01d9d119487b9932d022b22472cce4200
parent4092d532fe6dc0bf94bf61afe6e251b06754f6d0 (diff)
downloadFreeBSD-src-f22b416ddb62260d0b81c89a5d5d330c90b92170.zip
FreeBSD-src-f22b416ddb62260d0b81c89a5d5d330c90b92170.tar.gz
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
-rw-r--r--sys/kern/uipc_socket.c1
-rw-r--r--sys/netinet/tcp_input.c1
-rw-r--r--sys/netinet/tcp_syncache.c6
3 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 3db3e2c..29b400c 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -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
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 42ed197..2a14d14 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -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
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
index 65c1d51..23e2570 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -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;
OpenPOWER on IntegriCloud