Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F170992828
D50896.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D50896.diff
View Options
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
@@ -139,9 +139,10 @@
static void syncache_unpause(void *);
static void syncookie_reseed(void *);
#ifdef INVARIANTS
-static int syncookie_cmp(struct in_conninfo *inc, struct syncache_head *sch,
- struct syncache *sc, struct tcphdr *th, struct tcpopt *to,
- struct socket *lso, uint16_t port);
+static void syncookie_cmp(struct in_conninfo *,
+ const struct syncache_head *, struct syncache *,
+ struct tcphdr *, struct tcpopt *, struct socket *,
+ uint16_t);
#endif
/*
@@ -2348,43 +2349,43 @@
}
#ifdef INVARIANTS
-static int
-syncookie_cmp(struct in_conninfo *inc, struct syncache_head *sch,
+static void
+syncookie_cmp(struct in_conninfo *inc, const struct syncache_head *sch,
struct syncache *sc, struct tcphdr *th, struct tcpopt *to,
struct socket *lso, uint16_t port)
{
- struct syncache scs, *scx = NULL;
+ struct syncache scs;
char *s;
bzero(&scs, sizeof(scs));
- if (syncookie_expand(inc, sch, &scs, th, to, lso, port))
- scx = &scs;
+ if (syncookie_expand(inc, sch, &scs, th, to, lso, port) &&
+ (sc->sc_peer_mss != scs.sc_peer_mss ||
+ sc->sc_requested_r_scale != scs.sc_requested_r_scale ||
+ sc->sc_requested_s_scale != scs.sc_requested_s_scale ||
+ (sc->sc_flags & SCF_SACK) != (scs.sc_flags & SCF_SACK))) {
- if ((s = tcp_log_addrs(inc, th, NULL, NULL)) == NULL)
- return (0);
+ if ((s = tcp_log_addrs(inc, th, NULL, NULL)) == NULL)
+ return;
- if (scx != NULL) {
- if (sc->sc_peer_mss != scx->sc_peer_mss)
+ if (sc->sc_peer_mss != scs.sc_peer_mss)
log(LOG_DEBUG, "%s; %s: mss different %i vs %i\n",
- s, __func__, sc->sc_peer_mss, scx->sc_peer_mss);
+ s, __func__, sc->sc_peer_mss, scs.sc_peer_mss);
- if (sc->sc_requested_r_scale != scx->sc_requested_r_scale)
+ if (sc->sc_requested_r_scale != scs.sc_requested_r_scale)
log(LOG_DEBUG, "%s; %s: rwscale different %i vs %i\n",
s, __func__, sc->sc_requested_r_scale,
- scx->sc_requested_r_scale);
+ scs.sc_requested_r_scale);
- if (sc->sc_requested_s_scale != scx->sc_requested_s_scale)
+ if (sc->sc_requested_s_scale != scs.sc_requested_s_scale)
log(LOG_DEBUG, "%s; %s: swscale different %i vs %i\n",
s, __func__, sc->sc_requested_s_scale,
- scx->sc_requested_s_scale);
+ scs.sc_requested_s_scale);
- if ((sc->sc_flags & SCF_SACK) != (scx->sc_flags & SCF_SACK))
+ if ((sc->sc_flags & SCF_SACK) != (scs.sc_flags & SCF_SACK))
log(LOG_DEBUG, "%s; %s: SACK different\n", s, __func__);
- }
- if (s != NULL)
free(s, M_TCPLOG);
- return (0);
+ }
}
#endif /* INVARIANTS */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Sep 9, 1:45 AM (12 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38553590
Default Alt Text
D50896.diff (2 KB)
Attached To
Mode
D50896: tcp: refactor debug function syncookie_cmp()
Attached
Detach File
Event Timeline
Log In to Comment