summaryrefslogtreecommitdiff
path: root/networking/libiproute/iptunnel.c
diff options
context:
space:
mode:
authorDenis Vlasenko2009-03-05 09:21:57 +0000
committerDenis Vlasenko2009-03-05 09:21:57 +0000
commit76140a77c9c47c41f244d90d4250d77b9504f7d4 (patch)
tree67c43b25beb904f111e8a96548bee1592f5010e2 /networking/libiproute/iptunnel.c
parent021de3f0297af87bfc098bd364dffb332d6ace20 (diff)
downloadbusybox-76140a77c9c47c41f244d90d4250d77b9504f7d4.zip
busybox-76140a77c9c47c41f244d90d4250d77b9504f7d4.tar.gz
networking/libiproute/*: code shrink by optimizing numeric conversions
and other misc stuff function old new delta print_tunnel 660 656 -4 format_host 5 - -5 get_unsigned 70 54 -16 get_u32 70 54 -16 do_iplink 1173 1151 -22 get_prefix 417 393 -24 print_rule 800 771 -29 print_addrinfo 1374 1342 -32 print_route 1745 1709 -36 iprule_modify 905 866 -39 iproute_modify 1105 1048 -57 get_integer 70 - -70 parse_args 1684 1440 -244 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 0/11 up/down: 0/-594) Total: -594 bytes text data bss dec hex filename 817378 476 7892 825746 c9992 busybox_old 816784 476 7892 825152 c9740 busybox_unstripped
Diffstat (limited to 'networking/libiproute/iptunnel.c')
-rw-r--r--networking/libiproute/iptunnel.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c
index 5349587..6a841aa 100644
--- a/networking/libiproute/iptunnel.c
+++ b/networking/libiproute/iptunnel.c
@@ -232,9 +232,7 @@ static void parse_args(char **argv, int cmd, struct ip_tunnel_parm *p)
if (strchr(*argv, '.'))
p->i_key = p->o_key = get_addr32(*argv);
else {
- if (get_unsigned(&uval, *argv, 0) < 0) {
- invarg(*argv, "key");
- }
+ uval = get_unsigned(*argv, "key");
p->i_key = p->o_key = htonl(uval);
}
} else if (key == ARG_ikey) {
@@ -244,9 +242,7 @@ static void parse_args(char **argv, int cmd, struct ip_tunnel_parm *p)
if (strchr(*argv, '.'))
p->o_key = get_addr32(*argv);
else {
- if (get_unsigned(&uval, *argv, 0) < 0) {
- invarg(*argv, "ikey");
- }
+ uval = get_unsigned(*argv, "ikey");
p->i_key = htonl(uval);
}
} else if (key == ARG_okey) {
@@ -256,9 +252,7 @@ static void parse_args(char **argv, int cmd, struct ip_tunnel_parm *p)
if (strchr(*argv, '.'))
p->o_key = get_addr32(*argv);
else {
- if (get_unsigned(&uval, *argv, 0) < 0) {
- invarg(*argv, "okey");
- }
+ uval = get_unsigned(*argv, "okey");
p->o_key = htonl(uval);
}
} else if (key == ARG_seq) {
@@ -297,8 +291,7 @@ static void parse_args(char **argv, int cmd, struct ip_tunnel_parm *p)
NEXT_ARG();
key = index_in_strings(keywords, *argv);
if (key != ARG_inherit) {
- if (get_unsigned(&uval, *argv, 0))
- invarg(*argv, "TTL");
+ uval = get_unsigned(*argv, "TTL");
if (uval > 255)
invarg(*argv, "TTL must be <=255");
p->iph.ttl = uval;