diff options
author | rwatson <rwatson@FreeBSD.org> | 2002-05-14 18:57:55 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2002-05-14 18:57:55 +0000 |
commit | be8339f00b14bc22eb36be09c95a208a931ce889 (patch) | |
tree | 1ee9ee5796319ba8810cf6481889c2b5de473066 | |
parent | f2d1d929215ba777446f4422379ea3f48181b23f (diff) | |
download | FreeBSD-src-be8339f00b14bc22eb36be09c95a208a931ce889.zip FreeBSD-src-be8339f00b14bc22eb36be09c95a208a931ce889.tar.gz |
Modify the arguments to syncache_socket() to include the mbuf (m) that
results in the syncache entry being turned into a socket. While it's
not used in the main tree, this is required in the MAC tree so that
labels can be propagated from the mbuf to the socket. This is also
useful if you're doing things like transparent IP connection hijacking
and you want to use the syncache/cookie mechanism, but we won't go
there.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
-rw-r--r-- | sys/netinet/tcp_syncache.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 054586c..771fa82 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -95,7 +95,8 @@ static void syncache_free(struct syncache *); static void syncache_insert(struct syncache *, struct syncache_head *); struct syncache *syncache_lookup(struct in_conninfo *, struct syncache_head **); static int syncache_respond(struct syncache *, struct mbuf *); -static struct socket *syncache_socket(struct syncache *, struct socket *); +static struct socket *syncache_socket(struct syncache *, struct socket *, + struct mbuf *m); static void syncache_timer(void *); static u_int32_t syncookie_generate(struct syncache *); static struct syncache *syncookie_lookup(struct in_conninfo *, @@ -524,9 +525,10 @@ syncache_unreach(inc, th) * Build a new TCP socket structure from a syncache entry. */ static struct socket * -syncache_socket(sc, lso) +syncache_socket(sc, lso, m) struct syncache *sc; struct socket *lso; + struct mbuf *m; { struct inpcb *inp = NULL; struct socket *so; @@ -754,7 +756,7 @@ syncache_expand(inc, th, sop, m) if (th->th_ack != sc->sc_iss + 1) return (0); - so = syncache_socket(sc, *sop); + so = syncache_socket(sc, *sop, m); if (so == NULL) { #if 0 resetandabort: @@ -983,7 +985,7 @@ syncache_add(inc, to, th, sop, m) taop != NULL && taop->tao_cc != 0 && CC_GT(to->to_cc, taop->tao_cc)) { sc->sc_rxtslot = 0; - so = syncache_socket(sc, *sop); + so = syncache_socket(sc, *sop, m); if (so != NULL) { sc->sc_flags |= SCF_KEEPROUTE; taop->tao_cc = to->to_cc; |