From be8339f00b14bc22eb36be09c95a208a931ce889 Mon Sep 17 00:00:00 2001 From: rwatson Date: Tue, 14 May 2002 18:57:55 +0000 Subject: 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 --- sys/netinet/tcp_syncache.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sys/netinet/tcp_syncache.c') 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; -- cgit v1.1