Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/networking/libiproute/iptunnel.c
- Timestamp:
- Dec 20, 2016, 4:07:32 PM (7 years ago)
- Location:
- branches/3.3
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi-busybox/networking/libiproute/iptunnel.c
r3232 r3621 295 295 uval = get_unsigned(*argv, "TTL"); 296 296 if (uval > 255) 297 invarg (*argv, "TTL must be <=255");297 invarg_1_to_2(*argv, "TTL"); 298 298 p->iph.ttl = uval; 299 299 } … … 306 306 if (key != ARG_inherit) { 307 307 if (rtnl_dsfield_a2n(&uval, *argv)) 308 invarg (*argv, "TOS");308 invarg_1_to_2(*argv, "TOS"); 309 309 p->iph.tos = uval; 310 310 } else … … 405 405 static void print_tunnel(struct ip_tunnel_parm *p) 406 406 { 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]; 416 409 417 410 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 ); 423 419 if (p->link) { 424 420 char *n = do_ioctl_get_ifname(p->link); … … 433 429 printf(" ttl inherit "); 434 430 if (p->iph.tos) { 435 SPRINT_BUF(b1);436 431 printf(" tos"); 437 432 if (p->iph.tos & 1) … … 439 434 if (p->iph.tos & ~1) 440 435 printf("%c%s ", p->iph.tos & 1 ? '/' : ' ', 441 rtnl_dsfield_n2a(p->iph.tos & ~1 , b1));436 rtnl_dsfield_n2a(p->iph.tos & ~1)); 442 437 } 443 438 if (!(p->iph.frag_off & htons(IP_DF))) 444 439 printf(" nopmtudisc"); 445 440 441 inet_ntop(AF_INET, &p->i_key, s3, sizeof(s3)); 442 inet_ntop(AF_INET, &p->o_key, s4, sizeof(s4)); 446 443 if ((p->i_flags & GRE_KEY) && (p->o_flags & GRE_KEY) && p->o_key == p->i_key) 447 444 printf(" key %s", s3); 448 else if ((p->i_flags | p->o_flags) & GRE_KEY){445 else { 449 446 if (p->i_flags & GRE_KEY) 450 447 printf(" ikey %s ", s3); … … 562 559 563 560 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); 567 564 argv++; 568 565 if (key == ARG_add)
Note:
See TracChangeset
for help on using the changeset viewer.