* VIMAGE: assume curvnet set by caller. */
| 633 | * VIMAGE: assume curvnet set by caller. |
| 634 | */ |
| 635 | static struct igmp_ifsoftc * |
| 636 | igi_alloc_locked(/*const*/ struct ifnet *ifp) |
| 637 | { |
| 638 | struct igmp_ifsoftc *igi; |
| 639 | |
| 640 | IGMP_LOCK_ASSERT(); |
| 641 | |
| 642 | igi = malloc(sizeof(struct igmp_ifsoftc), M_IGMP, M_NOWAIT|M_ZERO); |
| 643 | if (igi == NULL) |
| 644 | goto out; |
| 645 | |
| 646 | igi->igi_ifp = ifp; |
| 647 | igi->igi_version = V_igmp_default_version; |
| 648 | igi->igi_flags = 0; |
| 649 | igi->igi_rv = IGMP_RV_INIT; |
| 650 | igi->igi_qi = IGMP_QI_INIT; |
| 651 | igi->igi_qri = IGMP_QRI_INIT; |
| 652 | igi->igi_uri = IGMP_URI_INIT; |
| 653 | mbufq_init(&igi->igi_gq, IGMP_MAX_RESPONSE_PACKETS); |
| 654 | |
| 655 | LIST_INSERT_HEAD(&V_igi_head, igi, igi_link); |
| 656 | |
| 657 | CTR2(KTR_IGMPV3, "allocate igmp_ifsoftc for ifp %p(%s)", |
| 658 | ifp, ifp->if_xname); |
| 659 | |
| 660 | out: |
| 661 | return (igi); |
| 662 | } |
| 663 | |
| 664 | /* |
| 665 | * Hook for ifdetach. |
no test coverage detected