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

Function sctp_insert_laddr

freebsd/netinet/sctp_pcb.c:2767–2788  ·  view source on GitHub ↗

* insert an laddr entry with the given ifa for the desired list */

Source from the content-addressed store, hash-verified

2765 * insert an laddr entry with the given ifa for the desired list
2766 */
2767static int
2768sctp_insert_laddr(struct sctpladdr *list, struct sctp_ifa *ifa, uint32_t act)
2769{
2770 struct sctp_laddr *laddr;
2771
2772 laddr = SCTP_ZONE_GET(SCTP_BASE_INFO(ipi_zone_laddr), struct sctp_laddr);
2773 if (laddr == NULL) {
2774 /* out of memory? */
2775 SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL);
2776 return (EINVAL);
2777 }
2778 SCTP_INCR_LADDR_COUNT();
2779 memset(laddr, 0, sizeof(*laddr));
2780 (void)SCTP_GETTIME_TIMEVAL(&laddr->start_time);
2781 laddr->ifa = ifa;
2782 laddr->action = act;
2783 atomic_add_int(&ifa->refcount, 1);
2784 /* insert it */
2785 LIST_INSERT_HEAD(list, laddr, sctp_nxt_addr);
2786
2787 return (0);
2788}
2789
2790/*
2791 * Remove an laddr entry from the local address list (on an assoc)

Callers 3

sctp_inpcb_bindFunction · 0.85
sctp_add_local_addr_epFunction · 0.85

Calls 1

memsetFunction · 0.85

Tested by

no test coverage detected