*: style fixes. no code changes (verified with objdump)

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2010-01-28 02:24:24 +01:00
parent 17323a6245
commit 6b9f163353
23 changed files with 231 additions and 160 deletions

View File

@ -163,20 +163,27 @@ static int FAST_FUNC print_route(const struct sockaddr_nl *who UNUSED_PARAM,
memset(tb, 0, sizeof(tb));
parse_rtattr(tb, RTA_MAX, RTM_RTA(r), len);
if (G_filter.rdst.family && inet_addr_match(&dst, &G_filter.rdst, G_filter.rdst.bitlen))
if (G_filter.rdst.family
&& inet_addr_match(&dst, &G_filter.rdst, G_filter.rdst.bitlen)
) {
return 0;
if (G_filter.mdst.family && G_filter.mdst.bitlen >= 0 &&
inet_addr_match(&dst, &G_filter.mdst, r->rtm_dst_len))
}
if (G_filter.mdst.family
&& G_filter.mdst.bitlen >= 0
&& inet_addr_match(&dst, &G_filter.mdst, r->rtm_dst_len)
) {
return 0;
if (G_filter.rsrc.family && inet_addr_match(&src, &G_filter.rsrc, G_filter.rsrc.bitlen))
}
if (G_filter.rsrc.family
&& inet_addr_match(&src, &G_filter.rsrc, G_filter.rsrc.bitlen)
) {
return 0;
}
if (G_filter.msrc.family && G_filter.msrc.bitlen >= 0
&& inet_addr_match(&src, &G_filter.msrc, r->rtm_src_len)
) {
return 0;
}
if (G_filter.flushb
&& r->rtm_family == AF_INET6
&& r->rtm_dst_len == 0

View File

@ -233,7 +233,8 @@ static int iprule_modify(int cmd, char **argv)
addattr_l(&req.n, sizeof(req), RTA_DST, &dst.data, dst.bytelen);
} else if (key == ARG_preference ||
key == ARG_order ||
key == ARG_priority) {
key == ARG_priority
) {
uint32_t pref;
NEXT_ARG();
pref = get_u32(*argv, "preference");
@ -256,7 +257,8 @@ static int iprule_modify(int cmd, char **argv)
invarg(*argv, "realms");
addattr32(&req.n, sizeof(req), RTA_FLOW, realm);
} else if (key == ARG_table ||
key == ARG_lookup) {
key == ARG_lookup
) {
uint32_t tid;
NEXT_ARG();
if (rtnl_rttable_a2n(&tid, *argv))
@ -264,11 +266,13 @@ static int iprule_modify(int cmd, char **argv)
req.r.rtm_table = tid;
table_ok = 1;
} else if (key == ARG_dev ||
key == ARG_iif) {
key == ARG_iif
) {
NEXT_ARG();
addattr_l(&req.n, sizeof(req), RTA_IIF, *argv, strlen(*argv)+1);
} else if (key == ARG_nat ||
key == ARG_map_to) {
key == ARG_map_to
) {
NEXT_ARG();
addattr32(&req.n, sizeof(req), RTA_GATEWAY, get_addr32(*argv));
req.r.rtm_type = RTN_NAT;

View File

@ -204,19 +204,22 @@ static void parse_args(char **argv, int cmd, struct ip_tunnel_parm *p)
NEXT_ARG();
key = index_in_strings(keywords, *argv);
if (key == ARG_ipip ||
key == ARG_ip_ip) {
key == ARG_ip_ip
) {
if (p->iph.protocol && p->iph.protocol != IPPROTO_IPIP) {
bb_error_msg_and_die("%s tunnel mode", "you managed to ask for more than one");
}
p->iph.protocol = IPPROTO_IPIP;
} else if (key == ARG_gre ||
key == ARG_gre_ip) {
key == ARG_gre_ip
) {
if (p->iph.protocol && p->iph.protocol != IPPROTO_GRE) {
bb_error_msg_and_die("%s tunnel mode", "you managed to ask for more than one");
}
p->iph.protocol = IPPROTO_GRE;
} else if (key == ARG_sit ||
key == ARG_ip6_ip) {
key == ARG_ip6_ip
) {
if (p->iph.protocol && p->iph.protocol != IPPROTO_IPV6) {
bb_error_msg_and_die("%s tunnel mode", "you managed to ask for more than one");
}
@ -297,7 +300,8 @@ static void parse_args(char **argv, int cmd, struct ip_tunnel_parm *p)
p->iph.ttl = uval;
}
} else if (key == ARG_tos ||
key == ARG_dsfield) {
key == ARG_dsfield
) {
uint32_t uval;
NEXT_ARG();
key = index_in_strings(keywords, *argv);
@ -485,7 +489,8 @@ static void do_tunnels_list(struct ip_tunnel_parm *p)
/*buf[sizeof(buf) - 1] = 0; - fgets is safe anyway */
ptr = strchr(buf, ':');
if (ptr == NULL ||
(*ptr++ = 0, sscanf(buf, "%s", name) != 1)) {
(*ptr++ = 0, sscanf(buf, "%s", name) != 1)
) {
bb_error_msg("wrong format of /proc/net/dev");
return;
}
@ -511,8 +516,10 @@ static void do_tunnels_list(struct ip_tunnel_parm *p)
(p->name[0] && strcmp(p1.name, p->name)) ||
(p->iph.daddr && p1.iph.daddr != p->iph.daddr) ||
(p->iph.saddr && p1.iph.saddr != p->iph.saddr) ||
(p->i_key && p1.i_key != p->i_key))
(p->i_key && p1.i_key != p->i_key)
) {
continue;
}
print_tunnel(&p1);
bb_putchar('\n');
}

View File

@ -147,7 +147,8 @@ static int rtnl_dump_filter(struct rtnl_handle *rth,
if (nladdr.nl_pid != 0 ||
h->nlmsg_pid != rth->local.nl_pid ||
h->nlmsg_seq != rth->dump) {
h->nlmsg_seq != rth->dump
) {
// if (junk) {
// err = junk(&nladdr, h, arg2);
// if (err < 0) {
@ -281,7 +282,8 @@ int FAST_FUNC rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n,
if (nladdr.nl_pid != peer ||
h->nlmsg_pid != rtnl->local.nl_pid ||
h->nlmsg_seq != seq) {
h->nlmsg_seq != seq
) {
// if (junk) {
// l_err = junk(&nladdr, h, jarg);
// if (l_err < 0) {

View File

@ -22,8 +22,9 @@ const char* FAST_FUNC ll_addr_n2a(unsigned char *addr, int alen, int type, char
int i;
int l;
if (alen == 4 &&
(type == ARPHRD_TUNNEL || type == ARPHRD_SIT || type == ARPHRD_IPGRE)) {
if (alen == 4
&& (type == ARPHRD_TUNNEL || type == ARPHRD_SIT || type == ARPHRD_IPGRE)
) {
return inet_ntop(AF_INET, addr, buf, blen);
}
l = 0;