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

Function sctp_add_local_addr_restricted

freebsd/netinet/sctp_pcb.c:5456–5486  ·  view source on GitHub ↗

* Add the address to the TCB local address restricted list. * This is a "pending" address list (eg. addresses waiting for an * ASCONF-ACK response) and cannot be used as a valid source address. */

Source from the content-addressed store, hash-verified

5454 * ASCONF-ACK response) and cannot be used as a valid source address.
5455 */
5456void
5457sctp_add_local_addr_restricted(struct sctp_tcb *stcb, struct sctp_ifa *ifa)
5458{
5459 struct sctp_laddr *laddr;
5460 struct sctpladdr *list;
5461
5462 /*
5463 * Assumes TCB is locked.. and possibly the INP. May need to
5464 * confirm/fix that if we need it and is not the case.
5465 */
5466 list = &stcb->asoc.sctp_restricted_addrs;
5467
5468#ifdef INET6
5469 if (ifa->address.sa.sa_family == AF_INET6) {
5470 if (ifa->localifa_flags & SCTP_ADDR_IFA_UNUSEABLE) {
5471 /* Can't bind a non-existent addr. */
5472 return;
5473 }
5474 }
5475#endif
5476 /* does the address already exist? */
5477 LIST_FOREACH(laddr, list, sctp_nxt_addr) {
5478 if (laddr->ifa == ifa) {
5479 return;
5480 }
5481 }
5482
5483 /* add to the list */
5484 (void)sctp_insert_laddr(list, ifa, 0);
5485 return;
5486}
5487
5488/*
5489 * Remove a local address from the TCB local address restricted list

Callers 4

sctp_choose_boundallFunction · 0.85
sctp_add_local_addr_epFunction · 0.85
sctp_addr_mgmt_assocFunction · 0.85

Calls 1

sctp_insert_laddrFunction · 0.85

Tested by

no test coverage detected