MCPcopy Create free account
hub / github.com/F-Stack/f-stack / syncookie_cmp

Function syncookie_cmp

freebsd/netinet/tcp_syncache.c:2386–2422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2384
2385#ifdef INVARIANTS
2386static int
2387syncookie_cmp(struct in_conninfo *inc, struct syncache_head *sch,
2388 struct syncache *sc, struct tcphdr *th, struct tcpopt *to,
2389 struct socket *lso)
2390{
2391 struct syncache scs, *scx;
2392 char *s;
2393
2394 bzero(&scs, sizeof(scs));
2395 scx = syncookie_lookup(inc, sch, &scs, th, to, lso);
2396
2397 if ((s = tcp_log_addrs(inc, th, NULL, NULL)) == NULL)
2398 return (0);
2399
2400 if (scx != NULL) {
2401 if (sc->sc_peer_mss != scx->sc_peer_mss)
2402 log(LOG_DEBUG, "%s; %s: mss different %i vs %i\n",
2403 s, __func__, sc->sc_peer_mss, scx->sc_peer_mss);
2404
2405 if (sc->sc_requested_r_scale != scx->sc_requested_r_scale)
2406 log(LOG_DEBUG, "%s; %s: rwscale different %i vs %i\n",
2407 s, __func__, sc->sc_requested_r_scale,
2408 scx->sc_requested_r_scale);
2409
2410 if (sc->sc_requested_s_scale != scx->sc_requested_s_scale)
2411 log(LOG_DEBUG, "%s; %s: swscale different %i vs %i\n",
2412 s, __func__, sc->sc_requested_s_scale,
2413 scx->sc_requested_s_scale);
2414
2415 if ((sc->sc_flags & SCF_SACK) != (scx->sc_flags & SCF_SACK))
2416 log(LOG_DEBUG, "%s; %s: SACK different\n", s, __func__);
2417 }
2418
2419 if (s != NULL)
2420 free(s, M_TCPLOG);
2421 return (0);
2422}
2423#endif /* INVARIANTS */
2424
2425static void

Callers 1

syncache_expandFunction · 0.85

Calls 5

bzeroFunction · 0.85
syncookie_lookupFunction · 0.85
tcp_log_addrsFunction · 0.85
logFunction · 0.50
freeFunction · 0.50

Tested by

no test coverage detected