Use TAILQ_FOREACH() instead of TAILQ_FOREACH_SAFE() for some loops that
do not modify the queues they iterate over. Submitted by: glebius
This commit is contained in:
parent
75ac3edf1d
commit
f5b50e25ec
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=229390
@ -1642,7 +1642,7 @@ igmp_fasttimo_vnet(void)
|
||||
struct ifqueue qrq; /* Query response packets */
|
||||
struct ifnet *ifp;
|
||||
struct igmp_ifinfo *igi;
|
||||
struct ifmultiaddr *ifma, *tifma;
|
||||
struct ifmultiaddr *ifma;
|
||||
struct in_multi *inm;
|
||||
int loop, uri_fasthz;
|
||||
|
||||
@ -1709,8 +1709,7 @@ igmp_fasttimo_vnet(void)
|
||||
}
|
||||
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link,
|
||||
tifma) {
|
||||
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family != AF_INET ||
|
||||
ifma->ifma_protospec == NULL)
|
||||
continue;
|
||||
@ -3321,7 +3320,7 @@ igmp_v3_merge_state_changes(struct in_multi *inm, struct ifqueue *ifscq)
|
||||
static void
|
||||
igmp_v3_dispatch_general_query(struct igmp_ifinfo *igi)
|
||||
{
|
||||
struct ifmultiaddr *ifma, *tifma;
|
||||
struct ifmultiaddr *ifma;
|
||||
struct ifnet *ifp;
|
||||
struct in_multi *inm;
|
||||
int retval, loop;
|
||||
@ -3335,7 +3334,7 @@ igmp_v3_dispatch_general_query(struct igmp_ifinfo *igi)
|
||||
ifp = igi->igi_ifp;
|
||||
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, tifma) {
|
||||
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family != AF_INET ||
|
||||
ifma->ifma_protospec == NULL)
|
||||
continue;
|
||||
|
@ -1325,7 +1325,7 @@ in6_purgeaddr(struct ifaddr *ifa)
|
||||
struct sockaddr_in6 mltaddr, mltmask;
|
||||
int plen, error;
|
||||
struct rtentry *rt;
|
||||
struct ifaddr *ifa0, *nifa;
|
||||
struct ifaddr *ifa0;
|
||||
|
||||
if (ifa->ifa_carp)
|
||||
(*carp_detach_p)(ifa);
|
||||
@ -1336,7 +1336,7 @@ in6_purgeaddr(struct ifaddr *ifa)
|
||||
* address routes
|
||||
*/
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_FOREACH_SAFE(ifa0, &ifp->if_addrhead, ifa_link, nifa) {
|
||||
TAILQ_FOREACH(ifa0, &ifp->if_addrhead, ifa_link) {
|
||||
if ((ifa0->ifa_addr->sa_family != AF_INET6) ||
|
||||
memcmp(&satosin6(ifa0->ifa_addr)->sin6_addr,
|
||||
&ia->ia_addr.sin6_addr,
|
||||
|
@ -2976,7 +2976,7 @@ mld_v2_merge_state_changes(struct in6_multi *inm, struct ifqueue *ifscq)
|
||||
static void
|
||||
mld_v2_dispatch_general_query(struct mld_ifinfo *mli)
|
||||
{
|
||||
struct ifmultiaddr *ifma, *tifma;
|
||||
struct ifmultiaddr *ifma;
|
||||
struct ifnet *ifp;
|
||||
struct in6_multi *inm;
|
||||
int retval;
|
||||
@ -2990,7 +2990,7 @@ mld_v2_dispatch_general_query(struct mld_ifinfo *mli)
|
||||
ifp = mli->mli_ifp;
|
||||
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, tifma) {
|
||||
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family != AF_INET6 ||
|
||||
ifma->ifma_protospec == NULL)
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user