From: Stephen Hemminger Date: Sat, 26 Feb 2011 04:00:54 +0000 (-0800) Subject: Remove #ifdef's X-Git-Url: https://rtime.felk.cvut.cz/gitweb/lisovros/iproute2_canprio.git/commitdiff_plain/d5b7420a269e6e220e00cfbd69546d157fac1332 Remove #ifdef's The iproute package keeps its own headers so there is no need of polluting code with #ifdef's --- diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 524ea01..a7350af 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -278,12 +278,10 @@ int print_linkinfo(const struct sockaddr_nl *who, fprintf(fp, "mtu %u ", *(int*)RTA_DATA(tb[IFLA_MTU])); if (tb[IFLA_QDISC]) fprintf(fp, "qdisc %s ", (char*)RTA_DATA(tb[IFLA_QDISC])); -#ifdef IFLA_MASTER if (tb[IFLA_MASTER]) { SPRINT_BUF(b1); fprintf(fp, "master %s ", ll_idx_n2a(*(int*)RTA_DATA(tb[IFLA_MASTER]), b1)); } -#endif if (tb[IFLA_OPERSTATE]) print_operstate(fp, *(__u8 *)RTA_DATA(tb[IFLA_OPERSTATE])); diff --git a/ip/iplink.c b/ip/iplink.c index 8c92bb1..48c0254 100644 --- a/ip/iplink.c +++ b/ip/iplink.c @@ -364,7 +364,6 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, if (len < 0) return -1; addattr_nest_end(&req->n, vflist); -#ifdef IFLA_MASTER } else if (matches(*argv, "master") == 0) { int ifindex; NEXT_ARG(); @@ -377,8 +376,6 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, int ifindex = 0; addattr_l(&req->n, sizeof(*req), IFLA_MASTER, &ifindex, 4); -#endif -#ifdef IFF_DYNAMIC } else if (matches(*argv, "dynamic") == 0) { NEXT_ARG(); req->i.ifi_change |= IFF_DYNAMIC; @@ -388,7 +385,6 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, req->i.ifi_flags &= ~IFF_DYNAMIC; } else return on_off("dynamic"); -#endif } else if (matches(*argv, "type") == 0) { NEXT_ARG(); *type = *argv; @@ -829,7 +825,6 @@ static int do_set(int argc, char **argv) flags |= IFF_NOARP; } else return on_off("noarp"); -#ifdef IFF_DYNAMIC } else if (matches(*argv, "dynamic") == 0) { NEXT_ARG(); mask |= IFF_DYNAMIC; @@ -839,7 +834,6 @@ static int do_set(int argc, char **argv) flags &= ~IFF_DYNAMIC; } else return on_off("dynamic"); -#endif } else { if (strcmp(*argv, "dev") == 0) { NEXT_ARG(); diff --git a/ip/ipneigh.c b/ip/ipneigh.c index 2d96ab7..dff9eb4 100644 --- a/ip/ipneigh.c +++ b/ip/ipneigh.c @@ -277,12 +277,10 @@ int print_neigh(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) ci->ndm_confirmed/hz, ci->ndm_updated/hz); } -#ifdef NDA_PROBES if (tb[NDA_PROBES] && show_stats) { __u32 p = *(__u32 *) RTA_DATA(tb[NDA_PROBES]); fprintf(fp, " probes %u", p); } -#endif if (r->ndm_state) { int nud = r->ndm_state; diff --git a/ip/iproute.c b/ip/iproute.c index 06d2507..2fef35b 100644 --- a/ip/iproute.c +++ b/ip/iproute.c @@ -478,12 +478,11 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) if (ci->rta_lastuse != 0) fprintf(fp, " age %dsec", ci->rta_lastuse/hz); } -#ifdef RTNETLINK_HAVE_PEERINFO if (ci->rta_id) fprintf(fp, " ipid 0x%04x", ci->rta_id); if (ci->rta_ts || ci->rta_tsage) - fprintf(fp, " ts 0x%x tsage %dsec", ci->rta_ts, ci->rta_tsage); -#endif + fprintf(fp, " ts 0x%x tsage %dsec", + ci->rta_ts, ci->rta_tsage); } } else if (r->rtm_family == AF_INET6) { struct rta_cacheinfo *ci = NULL; @@ -792,7 +791,6 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv) if (get_unsigned(&mtu, *argv, 0)) invarg("\"mtu\" value is invalid\n", *argv); rta_addattr32(mxrta, sizeof(mxbuf), RTAX_MTU, mtu); -#ifdef RTAX_HOPLIMIT } else if (strcmp(*argv, "hoplimit") == 0) { unsigned hoplimit; NEXT_ARG(); @@ -803,8 +801,6 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv) if (get_unsigned(&hoplimit, *argv, 0)) invarg("\"hoplimit\" value is invalid\n", *argv); rta_addattr32(mxrta, sizeof(mxbuf), RTAX_HOPLIMIT, hoplimit); -#endif -#ifdef RTAX_ADVMSS } else if (strcmp(*argv, "advmss") == 0) { unsigned mss; NEXT_ARG(); @@ -815,8 +811,6 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv) if (get_unsigned(&mss, *argv, 0)) invarg("\"mss\" value is invalid\n", *argv); rta_addattr32(mxrta, sizeof(mxbuf), RTAX_ADVMSS, mss); -#endif -#ifdef RTAX_REORDERING } else if (matches(*argv, "reordering") == 0) { unsigned reord; NEXT_ARG(); @@ -827,7 +821,6 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv) if (get_unsigned(&reord, *argv, 0)) invarg("\"reordering\" value is invalid\n", *argv); rta_addattr32(mxrta, sizeof(mxbuf), RTAX_REORDERING, reord); -#endif } else if (strcmp(*argv, "rtt") == 0) { unsigned rtt; NEXT_ARG(); diff --git a/lib/ll_proto.c b/lib/ll_proto.c index cdd1602..2277cda 100644 --- a/lib/ll_proto.c +++ b/lib/ll_proto.c @@ -36,19 +36,13 @@ static struct { } llproto_names[] = { __PF(LOOP,loop) __PF(PUP,pup) -#ifdef ETH_P_PUPAT __PF(PUPAT,pupat) -#endif __PF(IP,ip) __PF(X25,x25) __PF(ARP,arp) __PF(BPQ,bpq) -#ifdef ETH_P_IEEEPUP __PF(IEEEPUP,ieeepup) -#endif -#ifdef ETH_P_IEEEPUPAT __PF(IEEEPUPAT,ieeepupat) -#endif __PF(DEC,dec) __PF(DNA_DL,dna_dl) __PF(DNA_RC,dna_rc) @@ -62,19 +56,10 @@ __PF(ATALK,atalk) __PF(AARP,aarp) __PF(IPX,ipx) __PF(IPV6,ipv6) -#ifdef ETH_P_PPP_DISC __PF(PPP_DISC,ppp_disc) -#endif -#ifdef ETH_P_PPP_SES __PF(PPP_SES,ppp_ses) -#endif -#ifdef ETH_P_ATMMPOA __PF(ATMMPOA,atmmpoa) -#endif -#ifdef ETH_P_ATMFATE __PF(ATMFATE,atmfate) -#endif - __PF(802_3,802_3) __PF(AX25,ax25) __PF(ALL,all) @@ -90,9 +75,7 @@ __PF(TR_802_2,tr_802_2) __PF(MOBITEX,mobitex) __PF(CONTROL,control) __PF(IRDA,irda) -#ifdef ETH_P_ECONET __PF(ECONET,econet) -#endif __PF(TIPC,tipc) __PF(AOE,aoe)