diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-28 02:24:24 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-28 02:24:24 +0100 |
commit | 6b9f1633537e2ff06eb1a0741e4598a294f40fcb (patch) | |
tree | a13f4f3558c2988bc95b5a59c9996da64a0bd570 /networking | |
parent | 17323a6245597f16321e6bf99536ae9bb89c79cf (diff) | |
download | busybox-w32-6b9f1633537e2ff06eb1a0741e4598a294f40fcb.tar.gz busybox-w32-6b9f1633537e2ff06eb1a0741e4598a294f40fcb.tar.bz2 busybox-w32-6b9f1633537e2ff06eb1a0741e4598a294f40fcb.zip |
*: style fixes. no code changes (verified with objdump)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r-- | networking/libiproute/iproute.c | 19 | ||||
-rw-r--r-- | networking/libiproute/iprule.c | 12 | ||||
-rw-r--r-- | networking/libiproute/iptunnel.c | 19 | ||||
-rw-r--r-- | networking/libiproute/libnetlink.c | 6 | ||||
-rw-r--r-- | networking/libiproute/ll_addr.c | 5 | ||||
-rw-r--r-- | networking/tc.c | 19 |
6 files changed, 53 insertions, 27 deletions
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c index c4b3450dd..520cc820a 100644 --- a/networking/libiproute/iproute.c +++ b/networking/libiproute/iproute.c | |||
@@ -163,20 +163,27 @@ static int FAST_FUNC print_route(const struct sockaddr_nl *who UNUSED_PARAM, | |||
163 | memset(tb, 0, sizeof(tb)); | 163 | memset(tb, 0, sizeof(tb)); |
164 | parse_rtattr(tb, RTA_MAX, RTM_RTA(r), len); | 164 | parse_rtattr(tb, RTA_MAX, RTM_RTA(r), len); |
165 | 165 | ||
166 | if (G_filter.rdst.family && inet_addr_match(&dst, &G_filter.rdst, G_filter.rdst.bitlen)) | 166 | if (G_filter.rdst.family |
167 | && inet_addr_match(&dst, &G_filter.rdst, G_filter.rdst.bitlen) | ||
168 | ) { | ||
167 | return 0; | 169 | return 0; |
168 | if (G_filter.mdst.family && G_filter.mdst.bitlen >= 0 && | 170 | } |
169 | inet_addr_match(&dst, &G_filter.mdst, r->rtm_dst_len)) | 171 | if (G_filter.mdst.family |
172 | && G_filter.mdst.bitlen >= 0 | ||
173 | && inet_addr_match(&dst, &G_filter.mdst, r->rtm_dst_len) | ||
174 | ) { | ||
170 | return 0; | 175 | return 0; |
171 | 176 | } | |
172 | if (G_filter.rsrc.family && inet_addr_match(&src, &G_filter.rsrc, G_filter.rsrc.bitlen)) | 177 | if (G_filter.rsrc.family |
178 | && inet_addr_match(&src, &G_filter.rsrc, G_filter.rsrc.bitlen) | ||
179 | ) { | ||
173 | return 0; | 180 | return 0; |
181 | } | ||
174 | if (G_filter.msrc.family && G_filter.msrc.bitlen >= 0 | 182 | if (G_filter.msrc.family && G_filter.msrc.bitlen >= 0 |
175 | && inet_addr_match(&src, &G_filter.msrc, r->rtm_src_len) | 183 | && inet_addr_match(&src, &G_filter.msrc, r->rtm_src_len) |
176 | ) { | 184 | ) { |
177 | return 0; | 185 | return 0; |
178 | } | 186 | } |
179 | |||
180 | if (G_filter.flushb | 187 | if (G_filter.flushb |
181 | && r->rtm_family == AF_INET6 | 188 | && r->rtm_family == AF_INET6 |
182 | && r->rtm_dst_len == 0 | 189 | && r->rtm_dst_len == 0 |
diff --git a/networking/libiproute/iprule.c b/networking/libiproute/iprule.c index e7674530c..535019d87 100644 --- a/networking/libiproute/iprule.c +++ b/networking/libiproute/iprule.c | |||
@@ -233,7 +233,8 @@ static int iprule_modify(int cmd, char **argv) | |||
233 | addattr_l(&req.n, sizeof(req), RTA_DST, &dst.data, dst.bytelen); | 233 | addattr_l(&req.n, sizeof(req), RTA_DST, &dst.data, dst.bytelen); |
234 | } else if (key == ARG_preference || | 234 | } else if (key == ARG_preference || |
235 | key == ARG_order || | 235 | key == ARG_order || |
236 | key == ARG_priority) { | 236 | key == ARG_priority |
237 | ) { | ||
237 | uint32_t pref; | 238 | uint32_t pref; |
238 | NEXT_ARG(); | 239 | NEXT_ARG(); |
239 | pref = get_u32(*argv, "preference"); | 240 | pref = get_u32(*argv, "preference"); |
@@ -256,7 +257,8 @@ static int iprule_modify(int cmd, char **argv) | |||
256 | invarg(*argv, "realms"); | 257 | invarg(*argv, "realms"); |
257 | addattr32(&req.n, sizeof(req), RTA_FLOW, realm); | 258 | addattr32(&req.n, sizeof(req), RTA_FLOW, realm); |
258 | } else if (key == ARG_table || | 259 | } else if (key == ARG_table || |
259 | key == ARG_lookup) { | 260 | key == ARG_lookup |
261 | ) { | ||
260 | uint32_t tid; | 262 | uint32_t tid; |
261 | NEXT_ARG(); | 263 | NEXT_ARG(); |
262 | if (rtnl_rttable_a2n(&tid, *argv)) | 264 | if (rtnl_rttable_a2n(&tid, *argv)) |
@@ -264,11 +266,13 @@ static int iprule_modify(int cmd, char **argv) | |||
264 | req.r.rtm_table = tid; | 266 | req.r.rtm_table = tid; |
265 | table_ok = 1; | 267 | table_ok = 1; |
266 | } else if (key == ARG_dev || | 268 | } else if (key == ARG_dev || |
267 | key == ARG_iif) { | 269 | key == ARG_iif |
270 | ) { | ||
268 | NEXT_ARG(); | 271 | NEXT_ARG(); |
269 | addattr_l(&req.n, sizeof(req), RTA_IIF, *argv, strlen(*argv)+1); | 272 | addattr_l(&req.n, sizeof(req), RTA_IIF, *argv, strlen(*argv)+1); |
270 | } else if (key == ARG_nat || | 273 | } else if (key == ARG_nat || |
271 | key == ARG_map_to) { | 274 | key == ARG_map_to |
275 | ) { | ||
272 | NEXT_ARG(); | 276 | NEXT_ARG(); |
273 | addattr32(&req.n, sizeof(req), RTA_GATEWAY, get_addr32(*argv)); | 277 | addattr32(&req.n, sizeof(req), RTA_GATEWAY, get_addr32(*argv)); |
274 | req.r.rtm_type = RTN_NAT; | 278 | req.r.rtm_type = RTN_NAT; |
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c index 67afd1bfd..c36c7136f 100644 --- a/networking/libiproute/iptunnel.c +++ b/networking/libiproute/iptunnel.c | |||
@@ -204,19 +204,22 @@ static void parse_args(char **argv, int cmd, struct ip_tunnel_parm *p) | |||
204 | NEXT_ARG(); | 204 | NEXT_ARG(); |
205 | key = index_in_strings(keywords, *argv); | 205 | key = index_in_strings(keywords, *argv); |
206 | if (key == ARG_ipip || | 206 | if (key == ARG_ipip || |
207 | key == ARG_ip_ip) { | 207 | key == ARG_ip_ip |
208 | ) { | ||
208 | if (p->iph.protocol && p->iph.protocol != IPPROTO_IPIP) { | 209 | if (p->iph.protocol && p->iph.protocol != IPPROTO_IPIP) { |
209 | bb_error_msg_and_die("%s tunnel mode", "you managed to ask for more than one"); | 210 | bb_error_msg_and_die("%s tunnel mode", "you managed to ask for more than one"); |
210 | } | 211 | } |
211 | p->iph.protocol = IPPROTO_IPIP; | 212 | p->iph.protocol = IPPROTO_IPIP; |
212 | } else if (key == ARG_gre || | 213 | } else if (key == ARG_gre || |
213 | key == ARG_gre_ip) { | 214 | key == ARG_gre_ip |
215 | ) { | ||
214 | if (p->iph.protocol && p->iph.protocol != IPPROTO_GRE) { | 216 | if (p->iph.protocol && p->iph.protocol != IPPROTO_GRE) { |
215 | bb_error_msg_and_die("%s tunnel mode", "you managed to ask for more than one"); | 217 | bb_error_msg_and_die("%s tunnel mode", "you managed to ask for more than one"); |
216 | } | 218 | } |
217 | p->iph.protocol = IPPROTO_GRE; | 219 | p->iph.protocol = IPPROTO_GRE; |
218 | } else if (key == ARG_sit || | 220 | } else if (key == ARG_sit || |
219 | key == ARG_ip6_ip) { | 221 | key == ARG_ip6_ip |
222 | ) { | ||
220 | if (p->iph.protocol && p->iph.protocol != IPPROTO_IPV6) { | 223 | if (p->iph.protocol && p->iph.protocol != IPPROTO_IPV6) { |
221 | bb_error_msg_and_die("%s tunnel mode", "you managed to ask for more than one"); | 224 | bb_error_msg_and_die("%s tunnel mode", "you managed to ask for more than one"); |
222 | } | 225 | } |
@@ -297,7 +300,8 @@ static void parse_args(char **argv, int cmd, struct ip_tunnel_parm *p) | |||
297 | p->iph.ttl = uval; | 300 | p->iph.ttl = uval; |
298 | } | 301 | } |
299 | } else if (key == ARG_tos || | 302 | } else if (key == ARG_tos || |
300 | key == ARG_dsfield) { | 303 | key == ARG_dsfield |
304 | ) { | ||
301 | uint32_t uval; | 305 | uint32_t uval; |
302 | NEXT_ARG(); | 306 | NEXT_ARG(); |
303 | key = index_in_strings(keywords, *argv); | 307 | key = index_in_strings(keywords, *argv); |
@@ -485,7 +489,8 @@ static void do_tunnels_list(struct ip_tunnel_parm *p) | |||
485 | /*buf[sizeof(buf) - 1] = 0; - fgets is safe anyway */ | 489 | /*buf[sizeof(buf) - 1] = 0; - fgets is safe anyway */ |
486 | ptr = strchr(buf, ':'); | 490 | ptr = strchr(buf, ':'); |
487 | if (ptr == NULL || | 491 | if (ptr == NULL || |
488 | (*ptr++ = 0, sscanf(buf, "%s", name) != 1)) { | 492 | (*ptr++ = 0, sscanf(buf, "%s", name) != 1) |
493 | ) { | ||
489 | bb_error_msg("wrong format of /proc/net/dev"); | 494 | bb_error_msg("wrong format of /proc/net/dev"); |
490 | return; | 495 | return; |
491 | } | 496 | } |
@@ -511,8 +516,10 @@ static void do_tunnels_list(struct ip_tunnel_parm *p) | |||
511 | (p->name[0] && strcmp(p1.name, p->name)) || | 516 | (p->name[0] && strcmp(p1.name, p->name)) || |
512 | (p->iph.daddr && p1.iph.daddr != p->iph.daddr) || | 517 | (p->iph.daddr && p1.iph.daddr != p->iph.daddr) || |
513 | (p->iph.saddr && p1.iph.saddr != p->iph.saddr) || | 518 | (p->iph.saddr && p1.iph.saddr != p->iph.saddr) || |
514 | (p->i_key && p1.i_key != p->i_key)) | 519 | (p->i_key && p1.i_key != p->i_key) |
520 | ) { | ||
515 | continue; | 521 | continue; |
522 | } | ||
516 | print_tunnel(&p1); | 523 | print_tunnel(&p1); |
517 | bb_putchar('\n'); | 524 | bb_putchar('\n'); |
518 | } | 525 | } |
diff --git a/networking/libiproute/libnetlink.c b/networking/libiproute/libnetlink.c index 9e6467de5..ba24832d6 100644 --- a/networking/libiproute/libnetlink.c +++ b/networking/libiproute/libnetlink.c | |||
@@ -147,7 +147,8 @@ static int rtnl_dump_filter(struct rtnl_handle *rth, | |||
147 | 147 | ||
148 | if (nladdr.nl_pid != 0 || | 148 | if (nladdr.nl_pid != 0 || |
149 | h->nlmsg_pid != rth->local.nl_pid || | 149 | h->nlmsg_pid != rth->local.nl_pid || |
150 | h->nlmsg_seq != rth->dump) { | 150 | h->nlmsg_seq != rth->dump |
151 | ) { | ||
151 | // if (junk) { | 152 | // if (junk) { |
152 | // err = junk(&nladdr, h, arg2); | 153 | // err = junk(&nladdr, h, arg2); |
153 | // if (err < 0) { | 154 | // if (err < 0) { |
@@ -281,7 +282,8 @@ int FAST_FUNC rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, | |||
281 | 282 | ||
282 | if (nladdr.nl_pid != peer || | 283 | if (nladdr.nl_pid != peer || |
283 | h->nlmsg_pid != rtnl->local.nl_pid || | 284 | h->nlmsg_pid != rtnl->local.nl_pid || |
284 | h->nlmsg_seq != seq) { | 285 | h->nlmsg_seq != seq |
286 | ) { | ||
285 | // if (junk) { | 287 | // if (junk) { |
286 | // l_err = junk(&nladdr, h, jarg); | 288 | // l_err = junk(&nladdr, h, jarg); |
287 | // if (l_err < 0) { | 289 | // if (l_err < 0) { |
diff --git a/networking/libiproute/ll_addr.c b/networking/libiproute/ll_addr.c index f59831cc1..c2c01305d 100644 --- a/networking/libiproute/ll_addr.c +++ b/networking/libiproute/ll_addr.c | |||
@@ -22,8 +22,9 @@ const char* FAST_FUNC ll_addr_n2a(unsigned char *addr, int alen, int type, char | |||
22 | int i; | 22 | int i; |
23 | int l; | 23 | int l; |
24 | 24 | ||
25 | if (alen == 4 && | 25 | if (alen == 4 |
26 | (type == ARPHRD_TUNNEL || type == ARPHRD_SIT || type == ARPHRD_IPGRE)) { | 26 | && (type == ARPHRD_TUNNEL || type == ARPHRD_SIT || type == ARPHRD_IPGRE) |
27 | ) { | ||
27 | return inet_ntop(AF_INET, addr, buf, blen); | 28 | return inet_ntop(AF_INET, addr, buf, blen); |
28 | } | 29 | } |
29 | l = 0; | 30 | l = 0; |
diff --git a/networking/tc.c b/networking/tc.c index dbdba3317..541a0f8f4 100644 --- a/networking/tc.c +++ b/networking/tc.c | |||
@@ -470,17 +470,22 @@ int tc_main(int argc UNUSED_PARAM, char **argv) | |||
470 | msg.tcm_ifindex = xll_name_to_index(dev); | 470 | msg.tcm_ifindex = xll_name_to_index(dev); |
471 | if (cmd >= CMD_show) | 471 | if (cmd >= CMD_show) |
472 | filter_ifindex = msg.tcm_ifindex; | 472 | filter_ifindex = msg.tcm_ifindex; |
473 | } else if ((arg == ARG_qdisc && obj == OBJ_class && cmd >= CMD_show) | 473 | } else |
474 | || (arg == ARG_handle && obj == OBJ_qdisc | 474 | if ((arg == ARG_qdisc && obj == OBJ_class && cmd >= CMD_show) |
475 | && cmd == CMD_change)) { | 475 | || (arg == ARG_handle && obj == OBJ_qdisc && cmd == CMD_change) |
476 | ) { | ||
476 | NEXT_ARG(); | 477 | NEXT_ARG(); |
477 | /* We don't care about duparg2("qdisc handle",*argv) for now */ | 478 | /* We don't care about duparg2("qdisc handle",*argv) for now */ |
478 | if (get_qdisc_handle(&filter_qdisc, *argv)) | 479 | if (get_qdisc_handle(&filter_qdisc, *argv)) |
479 | invarg(*argv, "qdisc"); | 480 | invarg(*argv, "qdisc"); |
480 | } else if (obj != OBJ_qdisc && | 481 | } else |
481 | (arg == ARG_root | 482 | if (obj != OBJ_qdisc |
482 | || arg == ARG_parent | 483 | && (arg == ARG_root |
483 | || (obj == OBJ_filter && arg >= ARG_pref))) { | 484 | || arg == ARG_parent |
485 | || (obj == OBJ_filter && arg >= ARG_pref) | ||
486 | ) | ||
487 | ) { | ||
488 | /* nothing */ | ||
484 | } else { | 489 | } else { |
485 | invarg(*argv, "command"); | 490 | invarg(*argv, "command"); |
486 | } | 491 | } |