Page MenuHomeFreeBSD

D57104.id178380.diff
No OneTemporary

D57104.id178380.diff

diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -1559,6 +1559,7 @@
if (sc->sc_ipopts)
(void)m_free(sc->sc_ipopts);
sc->sc_ipopts = ipopts;
+ ipopts = NULL;
}
/*
* Update timestamp if present.
@@ -1673,6 +1674,8 @@
sc->sc_cred = NULL;
sc->sc_port = port;
sc->sc_ipopts = ipopts;
+ if (sc != &scs)
+ ipopts = NULL;
bcopy(inc, &sc->sc_inc, sizeof(struct in_conninfo));
sc->sc_ip_tos = ip_tos;
sc->sc_ip_ttl = ip_ttl;
@@ -1779,6 +1782,8 @@
if (tfo_cookie_valid) {
rv = syncache_tfo_expand(sc, so, m, tfo_response_cookie);
+ /* Synchronize ipopts as ownership may have been transferred. */
+ ipopts = sc->sc_ipopts;
/* INP_RUNLOCK(inp) will be performed by the caller */
goto tfo_expanded;
}
@@ -1819,13 +1824,12 @@
tfo_expanded:
if (cred != NULL)
crfree(cred);
- if (sc == NULL || sc == &scs) {
#ifdef MAC
+ if (sc == NULL || sc == &scs)
mac_syncache_destroy(&maclabel);
#endif
- if (ipopts)
- (void)m_free(ipopts);
- }
+ if (ipopts != NULL)
+ (void)m_free(ipopts);
return (rv);
}

File Metadata

Mime Type
text/plain
Expires
Sat, Aug 15, 8:23 PM (6 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33445486
Default Alt Text
D57104.id178380.diff (1 KB)

Event Timeline