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

Function sctp_del_local_addr_restricted

freebsd/netinet/sctp_pcb.c:5491–5528  ·  view source on GitHub ↗

* Remove a local address from the TCB local address restricted list */

Source from the content-addressed store, hash-verified

5489 * Remove a local address from the TCB local address restricted list
5490 */
5491void
5492sctp_del_local_addr_restricted(struct sctp_tcb *stcb, struct sctp_ifa *ifa)
5493{
5494 struct sctp_inpcb *inp;
5495 struct sctp_laddr *laddr;
5496
5497 /*
5498 * This is called by asconf work. It is assumed that a) The TCB is
5499 * locked and b) The INP is locked. This is true in as much as I can
5500 * trace through the entry asconf code where I did these locks.
5501 * Again, the ASCONF code is a bit different in that it does lock
5502 * the INP during its work often times. This must be since we don't
5503 * want other proc's looking up things while what they are looking
5504 * up is changing :-D
5505 */
5506
5507 inp = stcb->sctp_ep;
5508 /* if subset bound and don't allow ASCONF's, can't delete last */
5509 if (((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0) &&
5510 sctp_is_feature_off(inp, SCTP_PCB_FLAGS_DO_ASCONF)) {
5511 if (stcb->sctp_ep->laddr_count < 2) {
5512 /* can't delete last address */
5513 return;
5514 }
5515 }
5516 LIST_FOREACH(laddr, &stcb->asoc.sctp_restricted_addrs, sctp_nxt_addr) {
5517 /* remove the address if it exists */
5518 if (laddr->ifa == NULL)
5519 continue;
5520 if (laddr->ifa == ifa) {
5521 sctp_remove_laddr(laddr);
5522 return;
5523 }
5524 }
5525
5526 /* address not found! */
5527 return;
5528}
5529
5530/* sysctl */
5531static int sctp_max_number_of_assoc = SCTP_MAX_NUM_OF_ASOC;

Callers 3

sctp_asconf_queue_mgmtFunction · 0.85

Calls 1

sctp_remove_laddrFunction · 0.85

Tested by

no test coverage detected