Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/networking/libiproute/iptunnel.c

    r3232 r3621  
    295295                uval = get_unsigned(*argv, "TTL");
    296296                if (uval > 255)
    297                     invarg(*argv, "TTL must be <=255");
     297                    invarg_1_to_2(*argv, "TTL");
    298298                p->iph.ttl = uval;
    299299            }
     
    306306            if (key != ARG_inherit) {
    307307                if (rtnl_dsfield_a2n(&uval, *argv))
    308                     invarg(*argv, "TOS");
     308                    invarg_1_to_2(*argv, "TOS");
    309309                p->iph.tos = uval;
    310310            } else
     
    405405static void print_tunnel(struct ip_tunnel_parm *p)
    406406{
    407     char s1[256];
    408     char s2[256];
    409     char s3[64];
    410     char s4[64];
    411 
    412     format_host(AF_INET, 4, &p->iph.daddr, s1, sizeof(s1));
    413     format_host(AF_INET, 4, &p->iph.saddr, s2, sizeof(s2));
    414     inet_ntop(AF_INET, &p->i_key, s3, sizeof(s3));
    415     inet_ntop(AF_INET, &p->o_key, s4, sizeof(s4));
     407    char s3[INET_ADDRSTRLEN];
     408    char s4[INET_ADDRSTRLEN];
    416409
    417410    printf("%s: %s/ip  remote %s  local %s ",
    418            p->name,
    419            p->iph.protocol == IPPROTO_IPIP ? "ip" :
    420            (p->iph.protocol == IPPROTO_GRE ? "gre" :
    421         (p->iph.protocol == IPPROTO_IPV6 ? "ipv6" : "unknown")),
    422            p->iph.daddr ? s1 : "any", p->iph.saddr ? s2 : "any");
     411        p->name,
     412        p->iph.protocol == IPPROTO_IPIP ? "ip" :
     413            p->iph.protocol == IPPROTO_GRE ? "gre" :
     414            p->iph.protocol == IPPROTO_IPV6 ? "ipv6" :
     415            "unknown",
     416        p->iph.daddr ? format_host(AF_INET, 4, &p->iph.daddr) : "any",
     417        p->iph.saddr ? format_host(AF_INET, 4, &p->iph.saddr) : "any"
     418    );
    423419    if (p->link) {
    424420        char *n = do_ioctl_get_ifname(p->link);
     
    433429        printf(" ttl inherit ");
    434430    if (p->iph.tos) {
    435         SPRINT_BUF(b1);
    436431        printf(" tos");
    437432        if (p->iph.tos & 1)
     
    439434        if (p->iph.tos & ~1)
    440435            printf("%c%s ", p->iph.tos & 1 ? '/' : ' ',
    441                 rtnl_dsfield_n2a(p->iph.tos & ~1, b1));
     436                rtnl_dsfield_n2a(p->iph.tos & ~1));
    442437    }
    443438    if (!(p->iph.frag_off & htons(IP_DF)))
    444439        printf(" nopmtudisc");
    445440
     441    inet_ntop(AF_INET, &p->i_key, s3, sizeof(s3));
     442    inet_ntop(AF_INET, &p->o_key, s4, sizeof(s4));
    446443    if ((p->i_flags & GRE_KEY) && (p->o_flags & GRE_KEY) && p->o_key == p->i_key)
    447444        printf(" key %s", s3);
    448     else if ((p->i_flags | p->o_flags) & GRE_KEY) {
     445    else {
    449446        if (p->i_flags & GRE_KEY)
    450447            printf(" ikey %s ", s3);
     
    562559
    563560    if (*argv) {
    564         smalluint key = index_in_substrings(keywords, *argv);
    565         if (key > 5)
    566             bb_error_msg_and_die(bb_msg_invalid_arg, *argv, applet_name);
     561        int key = index_in_substrings(keywords, *argv);
     562        if (key < 0)
     563            invarg_1_to_2(*argv, applet_name);
    567564        argv++;
    568565        if (key == ARG_add)
Note: See TracChangeset for help on using the changeset viewer.