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

Function in_pcbgroup_update

freebsd/netinet/in_pcbgroup.c:469–493  ·  view source on GitHub ↗

* Two update paths: one in which the 4-tuple on an inpcb has been updated * and therefore connection groups may need to change (or a wildcard entry * may needed to be installed), and another in which the 4-tuple has been * set as a result of a packet received, in which case we may be able to use * the hash on the mbuf to avoid doing a software hash calculation for RSS. * * In each case: firs

Source from the content-addressed store, hash-verified

467 * otherwise, calculate and update the pcbgroup for the inpcb.
468 */
469void
470in_pcbgroup_update(struct inpcb *inp)
471{
472 struct inpcbinfo *pcbinfo;
473 struct inpcbgroup *newpcbgroup;
474
475 INP_WLOCK_ASSERT(inp);
476
477 pcbinfo = inp->inp_pcbinfo;
478 if (!in_pcbgroup_enabled(pcbinfo))
479 return;
480
481 in_pcbwild_update_internal(inp);
482 if (!(inp->inp_flags2 & INP_PCBGROUPWILD) &&
483 !(inp->inp_flags & INP_DROPPED)) {
484#ifdef INET6
485 if (inp->inp_vflag & INP_IPV6)
486 newpcbgroup = in6_pcbgroup_byinpcb(inp);
487 else
488#endif
489 newpcbgroup = in_pcbgroup_byinpcb(inp);
490 } else
491 newpcbgroup = NULL;
492 in_pcbgroup_update_internal(pcbinfo, newpcbgroup, inp);
493}
494
495void
496in_pcbgroup_update_mbuf(struct inpcb *inp, struct mbuf *m)

Callers 2

in_pcbinshash_internalFunction · 0.85
in_pcbrehash_mbufFunction · 0.85

Calls 5

in_pcbgroup_enabledFunction · 0.85
in6_pcbgroup_byinpcbFunction · 0.85
in_pcbgroup_byinpcbFunction · 0.85

Tested by

no test coverage detected