* insert an laddr entry with the given ifa for the desired list */
| 2765 | * insert an laddr entry with the given ifa for the desired list |
| 2766 | */ |
| 2767 | static int |
| 2768 | sctp_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) |
no test coverage detected