View | Details | Raw Unified | Return to bug 217401
Collapse All | Expand All

(-)sys/net/if_clone.c (-3 / +4 lines)
Lines 606-612 Link Here
606
ifc_alloc_unit(struct if_clone *ifc, int *unit)
606
ifc_alloc_unit(struct if_clone *ifc, int *unit)
607
{
607
{
608
	char name[IFNAMSIZ];
608
	char name[IFNAMSIZ];
609
	int wildcard;
609
	int wildcard, result;
610
610
611
	wildcard = (*unit < 0);
611
	wildcard = (*unit < 0);
612
retry:
612
retry:
Lines 617-624 Link Here
617
		if (*unit == -1)
617
		if (*unit == -1)
618
			return (ENOSPC);
618
			return (ENOSPC);
619
	} else {
619
	} else {
620
		*unit = alloc_unr_specific(ifc->ifc_unrhdr, *unit);
620
		result = alloc_unr_specific(ifc->ifc_unrhdr, *unit);
621
		if (*unit == -1) {
621
		if (result == -1) {
622
			if (wildcard) {
622
			if (wildcard) {
623
				(*unit)++;
623
				(*unit)++;
624
				goto retry;
624
				goto retry;
Lines 625-630 Link Here
625
			} else
625
			} else
626
				return (EEXIST);
626
				return (EEXIST);
627
		}
627
		}
628
		*unit = result;
628
	}
629
	}
629
630
630
	snprintf(name, IFNAMSIZ, "%s%d", ifc->ifc_name, *unit);
631
	snprintf(name, IFNAMSIZ, "%s%d", ifc->ifc_name, *unit);

Return to bug 217401