From 98984a8c623b592ddfb3b30ac92615422849eab3 Mon Sep 17 00:00:00 2001 From: Bart De Schuymer Date: Wed, 19 Jan 2005 21:09:05 +0000 Subject: add ebtablesu scheme, along with general cleanup --- userspace/ebtables2/extensions/ebt_ip.c | 2 +- userspace/ebtables2/extensions/ebt_limit.c | 18 +++++++++--------- userspace/ebtables2/extensions/ebt_vlan.c | 9 +++------ 3 files changed, 13 insertions(+), 16 deletions(-) (limited to 'userspace/ebtables2/extensions') diff --git a/userspace/ebtables2/extensions/ebt_ip.c b/userspace/ebtables2/extensions/ebt_ip.c index 6d9233e..c81e687 100644 --- a/userspace/ebtables2/extensions/ebt_ip.c +++ b/userspace/ebtables2/extensions/ebt_ip.c @@ -209,7 +209,7 @@ static int parse(int c, char **argv, int argc, const struct ebt_u_entry *entry, ipinfo->invflags |= EBT_IP_PROTO; if (optind > argc) ebt_print_error("Missing IP protocol argument"); - (unsigned char) i = strtoul(argv[optind - 1], &end, 10); + i = strtoul(argv[optind - 1], &end, 10); if (*end != '\0') { struct protoent *pe; diff --git a/userspace/ebtables2/extensions/ebt_limit.c b/userspace/ebtables2/extensions/ebt_limit.c index 1c5c32b..6dcd50d 100644 --- a/userspace/ebtables2/extensions/ebt_limit.c +++ b/userspace/ebtables2/extensions/ebt_limit.c @@ -203,15 +203,15 @@ static int compare(const struct ebt_entry_match* m1, const struct ebt_entry_matc static struct ebt_u_match limit_match = { - .name EBT_LIMIT_MATCH, - .size sizeof(struct ebt_limit_info), - .help print_help, - .init init, - .parse parse, - .final_check final_check, - .print print, - .compare compare, - .extra_ops opts, + .name = EBT_LIMIT_MATCH, + .size = sizeof(struct ebt_limit_info), + .help = print_help, + .init = init, + .parse = parse, + .final_check = final_check, + .print = print, + .compare = compare, + .extra_ops = opts, }; void _init(void) diff --git a/userspace/ebtables2/extensions/ebt_vlan.c b/userspace/ebtables2/extensions/ebt_vlan.c index b4e1d38..0c94a66 100644 --- a/userspace/ebtables2/extensions/ebt_vlan.c +++ b/userspace/ebtables2/extensions/ebt_vlan.c @@ -141,8 +141,7 @@ parse(int c, ebt_check_option(flags, OPT_VLAN_ID); CHECK_INV_FLAG(EBT_VLAN_ID); CHECK_IF_MISSING_VALUE; - (unsigned short) local.id = - strtoul(argv[optind - 1], &end, 10); + local.id = strtoul(argv[optind - 1], &end, 10); CHECK_RANGE(local.id > 4094 || *end != '\0'); vlaninfo->id = local.id; SET_BITMASK(EBT_VLAN_ID); @@ -152,8 +151,7 @@ parse(int c, ebt_check_option(flags, OPT_VLAN_PRIO); CHECK_INV_FLAG(EBT_VLAN_PRIO); CHECK_IF_MISSING_VALUE; - (unsigned char) local.prio = - strtoul(argv[optind - 1], &end, 10); + local.prio = strtoul(argv[optind - 1], &end, 10); CHECK_RANGE(local.prio >= 8 || *end != '\0'); vlaninfo->prio = local.prio; SET_BITMASK(EBT_VLAN_PRIO); @@ -163,8 +161,7 @@ parse(int c, ebt_check_option(flags, OPT_VLAN_ENCAP); CHECK_INV_FLAG(EBT_VLAN_ENCAP); CHECK_IF_MISSING_VALUE; - (unsigned short) local.encap = - strtoul(argv[optind - 1], &end, 16); + local.encap = strtoul(argv[optind - 1], &end, 16); if (*end != '\0') { ethent = getethertypebyname(argv[optind - 1]); if (ethent == NULL) -- cgit v1.2.3