Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

remove unneeded loop, use ifunit()

  • Loading branch information...
commit ad73c2e5edbff544f573e49c032ef7d72fac8b57 1 parent 965ac3d
authored October 06, 2004
8  freebsd4/sys/net/if.c
@@ -518,7 +518,6 @@ if_clone_create(name, len)
518 518
 	int len;
519 519
 {
520 520
 	struct if_clone *ifc;
521  
-	struct ifnet *ifp;
522 521
 	char *dp;
523 522
 	int wildcard;
524 523
 	int unit;
@@ -554,12 +553,7 @@ if_clone_create(name, len)
554 553
 	}
555 554
 
556 555
 	s = splimp();
557  
-	for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list)) {
558  
-		if (ifp == ifunit(name)) {
559  
-			if_attachdomain1(ifp);
560  
-			break;
561  
-		}
562  
-	}
  556
+	if_attachdomain1(ifunit(name));
563 557
 	splx(s);
564 558
 
565 559
 	return (0);
8  freebsd5/sys/net/if.c
@@ -668,7 +668,6 @@ int
668 668
 if_clone_create(char *name, int len)
669 669
 {
670 670
 	struct if_clone *ifc;
671  
-	struct ifnet *ifp;
672 671
 	char *dp;
673 672
 	int wildcard, bytoff, bitoff;
674 673
 	int unit;
@@ -733,12 +732,7 @@ if_clone_create(char *name, int len)
733 732
 	}
734 733
 
735 734
 	s = splimp();
736  
-	for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list)) {
737  
-		if (ifp == ifunit(name)) {
738  
-			if_attachdomain1(ifp);
739  
-			break;
740  
-		}
741  
-	}
  735
+	if_attachdomain1(ifunit(name));
742 736
 	splx(s);
743 737
 
744 738
 	return (0);
8  netbsd/sys/net/if.c
@@ -750,7 +750,6 @@ if_clone_create(name)
750 750
 	const char *name;
751 751
 {
752 752
 	struct if_clone *ifc;
753  
-	struct ifnet *ifp;
754 753
 	int unit;
755 754
 	int error;
756 755
 	int s;
@@ -767,12 +766,7 @@ if_clone_create(name)
767 766
 		return (error);
768 767
 
769 768
 	s = splnet();
770  
-	for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list)) {
771  
-		if (strcmp(name, ifp->if_xname) == 0) {
772  
-			if_attachdomain1(ifp);
773  
-			break;
774  
-		}
775  
-	}
  769
+	if_attachdomain1(ifunit(name));
776 770
 	splx(s);
777 771
 
778 772
 	return (error);
8  openbsd/sys/net/if.c
@@ -635,7 +635,6 @@ if_clone_create(name)
635 635
 	const char *name;
636 636
 {
637 637
 	struct if_clone *ifc;
638  
-	struct ifnet *ifp;
639 638
 	int unit;
640 639
 	int error;
641 640
 	int s;
@@ -652,12 +651,7 @@ if_clone_create(name)
652 651
 		return (error);
653 652
 
654 653
 	s = splnet();
655  
-	for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list)) {
656  
-		if (strcmp(name, ifp->if_xname) == 0) {
657  
-			if_attachdomain1(ifp);
658  
-			break;
659  
-		}
660  
-	}
  654
+	if_attachdomain1(ifunit(name));
661 655
 	splx(s);
662 656
 
663 657
 	return (error);

0 notes on commit ad73c2e

Please sign in to comment.
Something went wrong with that request. Please try again.