Allow trailing '*' wildcard in interface names.

This commit is contained in:
Simon Kelley
2013-03-15 20:30:51 +00:00
parent de92b479d9
commit 49333cbdbe
11 changed files with 42 additions and 24 deletions

View File

@@ -581,3 +581,20 @@ int read_write(int fd, unsigned char *packet, int size, int rw)
return 1;
}
/* Basically match a string value against a wildcard pattern. */
int wildcard_match(const char* wildcard, const char* match)
{
while (*wildcard && *match)
{
if (*wildcard == '*')
return 1;
if (*wildcard != *match)
return 0;
++wildcard;
++match;
}
return *wildcard == *match;
}