aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2015-07-14 14:12:05 +0100
committerRon Yorston <rmy@pobox.com>2015-07-14 14:12:05 +0100
commit895a1533781ca4713ef92113ab6ac5f2584ddd9d (patch)
tree49c8602e9cd733e6f6c105e94e614b8236677853 /networking
parent535ec990c50206697852d5c25e94a959f24d86bc (diff)
parent072fc60f29ee3a4ff38f095a9ef149b2e820c8c0 (diff)
downloadbusybox-w32-895a1533781ca4713ef92113ab6ac5f2584ddd9d.tar.gz
busybox-w32-895a1533781ca4713ef92113ab6ac5f2584ddd9d.tar.bz2
busybox-w32-895a1533781ca4713ef92113ab6ac5f2584ddd9d.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'networking')
-rw-r--r--networking/arp.c1
-rw-r--r--networking/ip.c2
-rw-r--r--networking/libiproute/ipaddress.c22
-rw-r--r--networking/netstat.c2
-rw-r--r--networking/ntpd.c1
-rw-r--r--networking/tc.c14
-rw-r--r--networking/tftp.c1
-rw-r--r--networking/wget.c1
8 files changed, 24 insertions, 20 deletions
diff --git a/networking/arp.c b/networking/arp.c
index e79b1b6a1..0099aa534 100644
--- a/networking/arp.c
+++ b/networking/arp.c
@@ -68,7 +68,6 @@ struct globals {
68 const struct hwtype *hw; /* current hardware type */ 68 const struct hwtype *hw; /* current hardware type */
69 const char *device; /* current device */ 69 const char *device; /* current device */
70 smallint hw_set; /* flag if hw-type was set (-H) */ 70 smallint hw_set; /* flag if hw-type was set (-H) */
71
72} FIX_ALIASING; 71} FIX_ALIASING;
73#define G (*(struct globals*)&bb_common_bufsiz1) 72#define G (*(struct globals*)&bb_common_bufsiz1)
74#define ap (G.ap ) 73#define ap (G.ap )
diff --git a/networking/ip.c b/networking/ip.c
index 98fe621b1..d35345c36 100644
--- a/networking/ip.c
+++ b/networking/ip.c
@@ -33,7 +33,7 @@
33//usage: "{ {add|del} IFADDR dev STRING | {show|flush}\n" 33//usage: "{ {add|del} IFADDR dev STRING | {show|flush}\n"
34//usage: " [dev STRING] [to PREFIX] }" 34//usage: " [dev STRING] [to PREFIX] }"
35//usage:#define ipaddr_full_usage "\n\n" 35//usage:#define ipaddr_full_usage "\n\n"
36//usage: "ipaddr {add|delete} IFADDR dev STRING\n" 36//usage: "ipaddr {add|change|replace|delete} IFADDR dev STRING\n"
37//usage: "ipaddr {show|flush} [dev STRING] [scope SCOPE-ID]\n" 37//usage: "ipaddr {show|flush} [dev STRING] [scope SCOPE-ID]\n"
38//usage: " [to PREFIX] [label PATTERN]\n" 38//usage: " [to PREFIX] [label PATTERN]\n"
39//usage: " IFADDR := PREFIX | ADDR peer PREFIX\n" 39//usage: " IFADDR := PREFIX | ADDR peer PREFIX\n"
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c
index 4072d0626..a6d5129e7 100644
--- a/networking/libiproute/ipaddress.c
+++ b/networking/libiproute/ipaddress.c
@@ -598,7 +598,7 @@ static int default_scope(inet_prefix *lcl)
598} 598}
599 599
600/* Return value becomes exitcode. It's okay to not return at all */ 600/* Return value becomes exitcode. It's okay to not return at all */
601static int ipaddr_modify(int cmd, char **argv) 601static int ipaddr_modify(int cmd, int flags, char **argv)
602{ 602{
603 static const char option[] ALIGN1 = 603 static const char option[] ALIGN1 =
604 "peer\0""remote\0""broadcast\0""brd\0" 604 "peer\0""remote\0""broadcast\0""brd\0"
@@ -622,7 +622,7 @@ static int ipaddr_modify(int cmd, char **argv)
622 memset(&req, 0, sizeof(req)); 622 memset(&req, 0, sizeof(req));
623 623
624 req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg)); 624 req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg));
625 req.n.nlmsg_flags = NLM_F_REQUEST; 625 req.n.nlmsg_flags = NLM_F_REQUEST | flags;
626 req.n.nlmsg_type = cmd; 626 req.n.nlmsg_type = cmd;
627 req.ifa.ifa_family = preferred_family; 627 req.ifa.ifa_family = preferred_family;
628 628
@@ -749,16 +749,24 @@ static int ipaddr_modify(int cmd, char **argv)
749int FAST_FUNC do_ipaddr(char **argv) 749int FAST_FUNC do_ipaddr(char **argv)
750{ 750{
751 static const char commands[] ALIGN1 = 751 static const char commands[] ALIGN1 =
752 "add\0""delete\0""list\0""show\0""lst\0""flush\0"; 752 /* 0 1 2 3 4 5 6 7 8 */
753 "add\0""change\0""chg\0""replace\0""delete\0""list\0""show\0""lst\0""flush\0";
753 int cmd = 2; 754 int cmd = 2;
754 if (*argv) { 755 if (*argv) {
755 cmd = index_in_substrings(commands, *argv); 756 cmd = index_in_substrings(commands, *argv);
756 if (cmd < 0) 757 if (cmd < 0)
757 invarg(*argv, applet_name); 758 invarg(*argv, applet_name);
758 argv++; 759 argv++;
759 if (cmd <= 1) 760 if (cmd <= 4) {
760 return ipaddr_modify((cmd == 0) ? RTM_NEWADDR : RTM_DELADDR, argv); 761 return ipaddr_modify(
762 /*cmd:*/ cmd == 4 ? RTM_DELADDR : RTM_NEWADDR,
763 /*flags:*/
764 cmd == 0 ? NLM_F_CREATE|NLM_F_EXCL : /* add */
765 cmd == 1 || cmd == 2 ? NLM_F_REPLACE : /* change */
766 cmd == 3 ? NLM_F_CREATE|NLM_F_REPLACE : /* replace */
767 0 /* delete */
768 , argv);
769 }
761 } 770 }
762 /* 2 == list, 3 == show, 4 == lst */ 771 return ipaddr_list_or_flush(argv, cmd == 8);
763 return ipaddr_list_or_flush(argv, cmd == 5);
764} 772}
diff --git a/networking/netstat.c b/networking/netstat.c
index 1303d3f3d..2196d42f7 100644
--- a/networking/netstat.c
+++ b/networking/netstat.c
@@ -119,7 +119,7 @@ typedef enum {
119#define ADDR_NORMAL_WIDTH 23 119#define ADDR_NORMAL_WIDTH 23
120/* When there are IPv6 connections the IPv6 addresses will be 120/* When there are IPv6 connections the IPv6 addresses will be
121 * truncated to none-recognition. The '-W' option makes the 121 * truncated to none-recognition. The '-W' option makes the
122 * address columns wide enough to accomodate for longest possible 122 * address columns wide enough to accommodate for longest possible
123 * IPv6 addresses, i.e. addresses of the form 123 * IPv6 addresses, i.e. addresses of the form
124 * xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:ddd.ddd.ddd.ddd 124 * xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:ddd.ddd.ddd.ddd
125 */ 125 */
diff --git a/networking/ntpd.c b/networking/ntpd.c
index 0233ed82c..b5120a70d 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -1497,7 +1497,6 @@ update_local_clock(peer_t *p)
1497#endif 1497#endif
1498 abs_offset = offset = 0; 1498 abs_offset = offset = 0;
1499 set_new_values(STATE_SYNC, offset, recv_time); 1499 set_new_values(STATE_SYNC, offset, recv_time);
1500
1501 } else { /* abs_offset <= STEP_THRESHOLD */ 1500 } else { /* abs_offset <= STEP_THRESHOLD */
1502 1501
1503 /* The ratio is calculated before jitter is updated to make 1502 /* The ratio is calculated before jitter is updated to make
diff --git a/networking/tc.c b/networking/tc.c
index 533f7c042..76e2e8359 100644
--- a/networking/tc.c
+++ b/networking/tc.c
@@ -151,17 +151,17 @@ static void print_rate(char *buf, int len, uint32_t rate)
151 double tmp = (double)rate*8; 151 double tmp = (double)rate*8;
152 152
153 if (use_iec) { 153 if (use_iec) {
154 if (tmp >= 1000.0*1024.0*1024.0) 154 if (tmp >= 1000*1024*1024)
155 snprintf(buf, len, "%.0fMibit", tmp/1024.0*1024.0); 155 snprintf(buf, len, "%.0fMibit", tmp/(1024*1024));
156 else if (tmp >= 1000.0*1024) 156 else if (tmp >= 1000*1024)
157 snprintf(buf, len, "%.0fKibit", tmp/1024); 157 snprintf(buf, len, "%.0fKibit", tmp/1024);
158 else 158 else
159 snprintf(buf, len, "%.0fbit", tmp); 159 snprintf(buf, len, "%.0fbit", tmp);
160 } else { 160 } else {
161 if (tmp >= 1000.0*1000000.0) 161 if (tmp >= 1000*1000000)
162 snprintf(buf, len, "%.0fMbit", tmp/1000000.0); 162 snprintf(buf, len, "%.0fMbit", tmp/1000000);
163 else if (tmp >= 1000.0 * 1000.0) 163 else if (tmp >= 1000*1000)
164 snprintf(buf, len, "%.0fKbit", tmp/1000.0); 164 snprintf(buf, len, "%.0fKbit", tmp/1000);
165 else 165 else
166 snprintf(buf, len, "%.0fbit", tmp); 166 snprintf(buf, len, "%.0fbit", tmp);
167 } 167 }
diff --git a/networking/tftp.c b/networking/tftp.c
index 7c0ee58d7..8ecd7bb6f 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -348,7 +348,6 @@ static int tftp_protocol(
348 * as if it is "block 0" */ 348 * as if it is "block 0" */
349 block_nr = 0; 349 block_nr = 0;
350 } 350 }
351
352 } else { /* tftp */ 351 } else { /* tftp */
353 /* Open file (must be after changing user) */ 352 /* Open file (must be after changing user) */
354 local_fd = CMD_GET(option_mask32) ? STDOUT_FILENO : STDIN_FILENO; 353 local_fd = CMD_GET(option_mask32) ? STDOUT_FILENO : STDIN_FILENO;
diff --git a/networking/wget.c b/networking/wget.c
index 42bfbb206..e09bd2368 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -1062,7 +1062,6 @@ However, in real world it was observed that some web servers
1062 1062
1063 /* For HTTP, data is pumped over the same connection */ 1063 /* For HTTP, data is pumped over the same connection */
1064 dfp = sfp; 1064 dfp = sfp;
1065
1066 } else { 1065 } else {
1067 /* 1066 /*
1068 * FTP session 1067 * FTP session