if.c (ea4ca115b7b110ada3d657044c19fab4c8766a52) | if.c (93ec7edca7b468b0a17047e5c6571237b09dcae5) |
---|---|
1/*- 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 726 unchanged lines hidden (view full) --- 735 } 736#endif /* INET6 */ 737 TAILQ_REMOVE(&ifp->if_addrhead, ifa, ifa_link); 738 ifa_free(ifa); 739 } 740} 741 742/* | 1/*- 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 726 unchanged lines hidden (view full) --- 735 } 736#endif /* INET6 */ 737 TAILQ_REMOVE(&ifp->if_addrhead, ifa, ifa_link); 738 ifa_free(ifa); 739 } 740} 741 742/* |
743 * Remove any multicast network addresses from an interface. | 743 * Remove any multicast network addresses from an interface when an ifnet 744 * is going away. |
744 */ | 745 */ |
745void | 746static void |
746if_purgemaddrs(struct ifnet *ifp) 747{ 748 struct ifmultiaddr *ifma; 749 struct ifmultiaddr *next; 750 751 IF_ADDR_LOCK(ifp); 752 TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) 753 if_delmulti_locked(ifp, ifma, 1); --- 2181 unchanged lines hidden (view full) --- 2935 if (lastref && ifp->if_ioctl != NULL) { 2936 (void)(*ifp->if_ioctl)(ifp, SIOCDELMULTI, 0); 2937 } 2938 2939 return (0); 2940} 2941 2942/* | 747if_purgemaddrs(struct ifnet *ifp) 748{ 749 struct ifmultiaddr *ifma; 750 struct ifmultiaddr *next; 751 752 IF_ADDR_LOCK(ifp); 753 TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) 754 if_delmulti_locked(ifp, ifma, 1); --- 2181 unchanged lines hidden (view full) --- 2936 if (lastref && ifp->if_ioctl != NULL) { 2937 (void)(*ifp->if_ioctl)(ifp, SIOCDELMULTI, 0); 2938 } 2939 2940 return (0); 2941} 2942 2943/* |
2944 * Delete all multicast group membership for an interface. 2945 * Should be used to quickly flush all multicast filters. 2946 */ 2947void 2948if_delallmulti(struct ifnet *ifp) 2949{ 2950 struct ifmultiaddr *ifma; 2951 struct ifmultiaddr *next; 2952 2953 IF_ADDR_LOCK(ifp); 2954 TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) 2955 if_delmulti_locked(ifp, ifma, 0); 2956 IF_ADDR_UNLOCK(ifp); 2957} 2958 2959/* |
|
2943 * Delete a multicast group membership by group membership pointer. 2944 * Network-layer protocol domains must use this routine. 2945 * 2946 * It is safe to call this routine if the ifp disappeared. 2947 */ 2948void 2949if_delmulti_ifma(struct ifmultiaddr *ifma) 2950{ --- 295 unchanged lines hidden --- | 2960 * Delete a multicast group membership by group membership pointer. 2961 * Network-layer protocol domains must use this routine. 2962 * 2963 * It is safe to call this routine if the ifp disappeared. 2964 */ 2965void 2966if_delmulti_ifma(struct ifmultiaddr *ifma) 2967{ --- 295 unchanged lines hidden --- |