diff options
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 c4b3450..520cc82 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, 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 diff --git a/networking/libiproute/iprule.c b/networking/libiproute/iprule.c index e767453..535019d 100644 --- a/networking/libiproute/iprule.c +++ b/networking/libiproute/iprule.c @@ -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; diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c index 67afd1b..c36c713 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) 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'); } diff --git a/networking/libiproute/libnetlink.c b/networking/libiproute/libnetlink.c index 9e6467d..ba24832 100644 --- a/networking/libiproute/libnetlink.c +++ b/networking/libiproute/libnetlink.c @@ -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) { diff --git a/networking/libiproute/ll_addr.c b/networking/libiproute/ll_addr.c index f59831c..c2c0130 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 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; diff --git a/networking/tc.c b/networking/tc.c index dbdba33..541a0f8 100644 --- a/networking/tc.c +++ b/networking/tc.c @@ -470,17 +470,22 @@ int tc_main(int argc UNUSED_PARAM, char **argv) msg.tcm_ifindex = xll_name_to_index(dev); if (cmd >= CMD_show) filter_ifindex = msg.tcm_ifindex; - } else if ((arg == ARG_qdisc && obj == OBJ_class && cmd >= CMD_show) - || (arg == ARG_handle && obj == OBJ_qdisc - && cmd == CMD_change)) { + } else + if ((arg == ARG_qdisc && obj == OBJ_class && cmd >= CMD_show) + || (arg == ARG_handle && obj == OBJ_qdisc && cmd == CMD_change) + ) { NEXT_ARG(); /* We don't care about duparg2("qdisc handle",*argv) for now */ if (get_qdisc_handle(&filter_qdisc, *argv)) invarg(*argv, "qdisc"); - } else if (obj != OBJ_qdisc && - (arg == ARG_root - || arg == ARG_parent - || (obj == OBJ_filter && arg >= ARG_pref))) { + } else + if (obj != OBJ_qdisc + && (arg == ARG_root + || arg == ARG_parent + || (obj == OBJ_filter && arg >= ARG_pref) + ) + ) { + /* nothing */ } else { invarg(*argv, "command"); } |