aboutsummaryrefslogtreecommitdiff
path: root/networking/libiproute/iptunnel.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/libiproute/iptunnel.c')
-rw-r--r--networking/libiproute/iptunnel.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c
index 806d8657d..2b9d3055e 100644
--- a/networking/libiproute/iptunnel.c
+++ b/networking/libiproute/iptunnel.c
@@ -164,26 +164,26 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
164 if (strcmp(*argv, "ipip") == 0 || 164 if (strcmp(*argv, "ipip") == 0 ||
165 strcmp(*argv, "ip/ip") == 0) { 165 strcmp(*argv, "ip/ip") == 0) {
166 if (p->iph.protocol && p->iph.protocol != IPPROTO_IPIP) { 166 if (p->iph.protocol && p->iph.protocol != IPPROTO_IPIP) {
167 bb_error_msg("You managed to ask for more than one tunnel mode."); 167 bb_error_msg("you managed to ask for more than one tunnel mode");
168 exit(-1); 168 exit(-1);
169 } 169 }
170 p->iph.protocol = IPPROTO_IPIP; 170 p->iph.protocol = IPPROTO_IPIP;
171 } else if (strcmp(*argv, "gre") == 0 || 171 } else if (strcmp(*argv, "gre") == 0 ||
172 strcmp(*argv, "gre/ip") == 0) { 172 strcmp(*argv, "gre/ip") == 0) {
173 if (p->iph.protocol && p->iph.protocol != IPPROTO_GRE) { 173 if (p->iph.protocol && p->iph.protocol != IPPROTO_GRE) {
174 bb_error_msg("You managed to ask for more than one tunnel mode."); 174 bb_error_msg("you managed to ask for more than one tunnel mode");
175 exit(-1); 175 exit(-1);
176 } 176 }
177 p->iph.protocol = IPPROTO_GRE; 177 p->iph.protocol = IPPROTO_GRE;
178 } else if (strcmp(*argv, "sit") == 0 || 178 } else if (strcmp(*argv, "sit") == 0 ||
179 strcmp(*argv, "ipv6/ip") == 0) { 179 strcmp(*argv, "ipv6/ip") == 0) {
180 if (p->iph.protocol && p->iph.protocol != IPPROTO_IPV6) { 180 if (p->iph.protocol && p->iph.protocol != IPPROTO_IPV6) {
181 bb_error_msg("You managed to ask for more than one tunnel mode."); 181 bb_error_msg("you managed to ask for more than one tunnel mode");
182 exit(-1); 182 exit(-1);
183 } 183 }
184 p->iph.protocol = IPPROTO_IPV6; 184 p->iph.protocol = IPPROTO_IPV6;
185 } else { 185 } else {
186 bb_error_msg("Cannot guess tunnel mode."); 186 bb_error_msg("cannot guess tunnel mode");
187 exit(-1); 187 exit(-1);
188 } 188 }
189 } else if (strcmp(*argv, "key") == 0) { 189 } else if (strcmp(*argv, "key") == 0) {
@@ -306,7 +306,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
306 306
307 if (p->iph.protocol == IPPROTO_IPIP || p->iph.protocol == IPPROTO_IPV6) { 307 if (p->iph.protocol == IPPROTO_IPIP || p->iph.protocol == IPPROTO_IPV6) {
308 if ((p->i_flags & GRE_KEY) || (p->o_flags & GRE_KEY)) { 308 if ((p->i_flags & GRE_KEY) || (p->o_flags & GRE_KEY)) {
309 bb_error_msg("Keys are not allowed with ipip and sit."); 309 bb_error_msg("keys are not allowed with ipip and sit");
310 return -1; 310 return -1;
311 } 311 }
312 } 312 }
@@ -326,7 +326,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
326 p->o_flags |= GRE_KEY; 326 p->o_flags |= GRE_KEY;
327 } 327 }
328 if (IN_MULTICAST(ntohl(p->iph.daddr)) && !p->iph.saddr) { 328 if (IN_MULTICAST(ntohl(p->iph.daddr)) && !p->iph.saddr) {
329 bb_error_msg("Broadcast tunnel requires a source address."); 329 bb_error_msg("broadcast tunnel requires a source address");
330 return -1; 330 return -1;
331 } 331 }
332 return 0; 332 return 0;
@@ -462,7 +462,7 @@ static int do_tunnels_list(struct ip_tunnel_parm *p)
462 buf[sizeof(buf) - 1] = 0; 462 buf[sizeof(buf) - 1] = 0;
463 if ((ptr = strchr(buf, ':')) == NULL || 463 if ((ptr = strchr(buf, ':')) == NULL ||
464 (*ptr++ = 0, sscanf(buf, "%s", name) != 1)) { 464 (*ptr++ = 0, sscanf(buf, "%s", name) != 1)) {
465 bb_error_msg("Wrong format of /proc/net/dev. Sorry."); 465 bb_error_msg("wrong format of /proc/net/dev. Sorry");
466 return -1; 466 return -1;
467 } 467 }
468 if (sscanf(ptr, "%lu%lu%lu%lu%lu%lu%lu%*d%lu%lu%lu%lu%lu%lu%lu", 468 if (sscanf(ptr, "%lu%lu%lu%lu%lu%lu%lu%*d%lu%lu%lu%lu%lu%lu%lu",
@@ -475,7 +475,7 @@ static int do_tunnels_list(struct ip_tunnel_parm *p)
475 continue; 475 continue;
476 type = do_ioctl_get_iftype(name); 476 type = do_ioctl_get_iftype(name);
477 if (type == -1) { 477 if (type == -1) {
478 bb_error_msg("Failed to get type of [%s]", name); 478 bb_error_msg("failed to get type of [%s]", name);
479 continue; 479 continue;
480 } 480 }
481 if (type != ARPHRD_TUNNEL && type != ARPHRD_IPGRE && type != ARPHRD_SIT) 481 if (type != ARPHRD_TUNNEL && type != ARPHRD_IPGRE && type != ARPHRD_SIT)
@@ -490,7 +490,7 @@ static int do_tunnels_list(struct ip_tunnel_parm *p)
490 (p->i_key && p1.i_key != p->i_key)) 490 (p->i_key && p1.i_key != p->i_key))
491 continue; 491 continue;
492 print_tunnel(&p1); 492 print_tunnel(&p1);
493 printf("\n"); 493 puts("");
494 } 494 }
495 return 0; 495 return 0;
496} 496}
@@ -521,7 +521,7 @@ static int do_show(int argc, char **argv)
521 return -1; 521 return -1;
522 522
523 print_tunnel(&p); 523 print_tunnel(&p);
524 printf("\n"); 524 puts("");
525 return 0; 525 return 0;
526} 526}
527 527
@@ -541,6 +541,6 @@ int do_iptunnel(int argc, char **argv)
541 } else 541 } else
542 return do_show(0, NULL); 542 return do_show(0, NULL);
543 543
544 bb_error_msg("Command \"%s\" is unknown.", *argv); 544 bb_error_msg("command \"%s\" is unknown", *argv);
545 exit(-1); 545 exit(-1);
546} 546}