source: freewrt/package/ebtables/patches/ebtables-2.0.6-gcc4.patch@ d419478

freewrt_1_0 freewrt_2_0
Last change on this file since d419478 was 475ad56, checked in by Waldemar Brodkorb <wbx@…>, 20 years ago

add OpenWrt trunk revision 3830.

git-svn-id: svn://www.freewrt.org/trunk/freewrt@1 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 3.9 KB
  • extensions/ebt_ip.c

    # --- T2-COPYRIGHT-NOTE-BEGIN ---
    # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
    # 
    # T2 SDE: package/.../ebtables/gcc4.patch
    # Copyright (C) 2004 - 2005 The T2 SDE Project
    # 
    # More information can be found in the files COPYING and README.
    # 
    # This patch file is dual-licensed. It is available under the license the
    # patched project is licensed under, as long as it is an OpenSource license
    # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
    # of the GNU General Public License as published by the Free Software
    # Foundation; either version 2 of the License, or (at your option) any later
    # version.
    # --- T2-COPYRIGHT-NOTE-END ---
    diff -Nur ebtables-v2.0.6.orig/extensions/ebt_ip.c ebtables-v2.0.6/extensions/ebt_ip.c
    old new  
    244244        struct ebt_ip_info *ipinfo = (struct ebt_ip_info *)(*match)->data;
    245245        char *end;
    246246        long int i;
     247        unsigned char j;
    247248
    248249        switch (c) {
    249250        case IP_SOURCE:
     
    313314                        ipinfo->invflags |= EBT_IP_PROTO;
    314315                if (optind > argc)
    315316                        print_error("Missing IP protocol argument");
    316                 (unsigned char) i = strtoul(argv[optind - 1], &end, 10);
     317                j = strtoul(argv[optind - 1], &end, 10);
    317318                if (*end != '\0') {
    318319                        struct protoent *pe;
    319320
     
    324325                                     argv[optind - 1]);
    325326                        ipinfo->protocol = pe->p_proto;
    326327                } else {
    327                         ipinfo->protocol = (unsigned char) i;
     328                        ipinfo->protocol = j;
    328329                }
    329330                ipinfo->bitmask |= EBT_IP_PROTO;
    330331                break;
  • extensions/ebt_limit.c

    diff -Nur ebtables-v2.0.6.orig/extensions/ebt_limit.c ebtables-v2.0.6/extensions/ebt_limit.c
    old new  
    203203
    204204static struct ebt_u_match limit_match =
    205205{
    206         .name           EBT_LIMIT_MATCH,
    207         .size           sizeof(struct ebt_limit_info),
    208         .help           print_help,
    209         .init           init,
    210         .parse          parse,
    211         .final_check    final_check,
    212         .print          print,
    213         .compare        compare,
    214         .extra_ops      opts,
     206        .name   =       EBT_LIMIT_MATCH,
     207        .size   =       sizeof(struct ebt_limit_info),
     208        .help   =       print_help,
     209        .init   =       init,
     210        .parse  =       parse,
     211        .final_check =  final_check,
     212        .print  =       print,
     213        .compare =      compare,
     214        .extra_ops =    opts,
    215215};
    216216
    217217static void _init(void) __attribute((constructor));
  • extensions/ebt_vlan.c

    diff -Nur ebtables-v2.0.6.orig/extensions/ebt_vlan.c ebtables-v2.0.6/extensions/ebt_vlan.c
    old new  
    135135            (struct ebt_vlan_info *) (*match)->data;
    136136        char *end;
    137137        struct ebt_vlan_info local;
     138        unsigned short id, encap;
     139        unsigned char prio;
    138140
    139141        switch (c) {
    140142        case VLAN_ID:
    141143                check_option(flags, OPT_VLAN_ID);
    142144                CHECK_INV_FLAG(EBT_VLAN_ID);
    143145                CHECK_IF_MISSING_VALUE;
    144                 (unsigned short) local.id =
    145                     strtoul(argv[optind - 1], &end, 10);
     146                id = strtoul(argv[optind - 1], &end, 10);
     147                local.id = (uint16_t) id;
    146148                CHECK_RANGE(local.id > 4094 || *end != '\0');
    147149                vlaninfo->id = local.id;
    148150                SET_BITMASK(EBT_VLAN_ID);
     
    152154                check_option(flags, OPT_VLAN_PRIO);
    153155                CHECK_INV_FLAG(EBT_VLAN_PRIO);
    154156                CHECK_IF_MISSING_VALUE;
    155                 (unsigned char) local.prio =
    156                     strtoul(argv[optind - 1], &end, 10);
     157                prio = strtoul(argv[optind - 1], &end, 10);
     158                local.prio = (uint8_t) prio;
    157159                CHECK_RANGE(local.prio >= 8 || *end != '\0');
    158160                vlaninfo->prio = local.prio;
    159161                SET_BITMASK(EBT_VLAN_PRIO);
     
    163165                check_option(flags, OPT_VLAN_ENCAP);
    164166                CHECK_INV_FLAG(EBT_VLAN_ENCAP);
    165167                CHECK_IF_MISSING_VALUE;
    166                 (unsigned short) local.encap =
    167                     strtoul(argv[optind - 1], &end, 16);
     168                encap = strtoul(argv[optind - 1], &end, 16);
     169                local.encap = (uint16_t) encap;
    168170                if (*end != '\0') {
    169171                        ethent = getethertypebyname(argv[optind - 1]);
    170172                        if (ethent == NULL)
Note: See TracBrowser for help on using the repository browser.