summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2010-01-04 22:44:48 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2010-01-04 22:44:48 +0000
commiteee4cfb98fc1b3185d3bea1aad559feba31ee4c6 (patch)
treeadaddac7f001ca05d456bb6ba874afe5808d5f80
parent1b1bff673f381cd2b33c37bdb66499ef6da0a3f2 (diff)
Notes
-rw-r--r--sys/net/if_vlan.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 126d83ffb35d..f23541e230d9 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -577,7 +577,7 @@ vlan_clone_match_ethertag(struct if_clone *ifc, const char *name, int *tag)
{
const char *cp;
struct ifnet *ifp;
- int t = 0;
+ int t;
/* Check for <etherif>.<vlan> style interface names. */
IFNET_RLOCK_NOSLEEP();
@@ -587,13 +587,15 @@ vlan_clone_match_ethertag(struct if_clone *ifc, const char *name, int *tag)
if (strncmp(ifp->if_xname, name, strlen(ifp->if_xname)) != 0)
continue;
cp = name + strlen(ifp->if_xname);
- if (*cp != '.')
+ if (*cp++ != '.')
continue;
- for(; *cp != '\0'; cp++) {
- if (*cp < '0' || *cp > '9')
- continue;
+ if (*cp == '\0')
+ continue;
+ t = 0;
+ for(; *cp >= '0' && *cp <= '9'; cp++)
t = (t * 10) + (*cp - '0');
- }
+ if (*cp != '\0')
+ continue;
if (tag != NULL)
*tag = t;
break;