summaryrefslogtreecommitdiffstats
path: root/userspace/ebtables2
diff options
context:
space:
mode:
authorBart De Schuymer <bdschuym@pandora.be>2002-06-26 18:58:17 +0000
committerBart De Schuymer <bdschuym@pandora.be>2002-06-26 18:58:17 +0000
commit1a44a9be520a63f0d365cc402b75aa91dd008dec (patch)
tree3163765d42bfdf75fcb9c235b4a866d95d82a8c2 /userspace/ebtables2
parent0faacbcb1ec41be3deb70b18b98c1ede2068c20d (diff)
name_to_number()
Diffstat (limited to 'userspace/ebtables2')
-rw-r--r--userspace/ebtables2/extensions/ebt_vlan.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/userspace/ebtables2/extensions/ebt_vlan.c b/userspace/ebtables2/extensions/ebt_vlan.c
index 5c8504d..345996d 100644
--- a/userspace/ebtables2/extensions/ebt_vlan.c
+++ b/userspace/ebtables2/extensions/ebt_vlan.c
@@ -106,6 +106,7 @@ parse (int c,
(struct ebt_vlan_info *) (*match)->data;
unsigned long i;
char *end;
+ __u16 encap;
switch (c) {
case VLAN_ID:
/*
@@ -186,19 +187,19 @@ parse (int c,
* Parameter can be decimal, hexadecimal, or string.
* Check arg val range (still raw area)
*/
- (unsigned short) i = strtol (argv[optind - 1], &end, 16);
- if (*end == '\0' && (i < ETH_ZLEN || i > 0xFFFF))
+ (unsigned short) encap = strtol (argv[optind - 1], &end, 16);
+ if (*end == '\0' && (encap < ETH_ZLEN || encap > 0xFFFF))
print_error
("Specified encapsulated frame type is out of range\n");
if (*end != '\0')
- if (name_to_protocol (argv[optind - 1]) == -1)
+ if (name_to_number (argv[optind - 1], &encap) == -1)
print_error
("Problem with the specified encapsulated"
"protocol\n");
/*
* Set up parameter value (network notation)
*/
- vlaninfo->encap = htons (i);
+ vlaninfo->encap = htons (encap);
/*
* Set up parameter presence flag
*/