diff -urN iproute2-2.4.7-010824/Makefile iproute2-2.4.7-wt011202/Makefile --- iproute2-2.4.7-010824/Makefile Thu Aug 2 08:37:03 2001 +++ iproute2-2.4.7-wt011202/Makefile Sun Dec 2 16:48:06 2001 @@ -1,22 +1,46 @@ # Path to parent kernel include files directory +DESTDIR= +SBINDIR=/sbin +CONFDIR=/etc/iproute2 +DOCDIR=/usr/doc/iproute2 + KERNEL_INCLUDE=/usr/src/linux/include LIBC_INCLUDE=/usr/include -DEFINES= -DRESOLVE_HOSTNAMES - -#options if you have a bind>=4.9.4 libresolv (or, maybe, glibc) -LDLIBS=-lresolv +DEFINES= +LDLIBS= ADDLIB= +USE_IPV6=n +USE_DECNET=n +USE_IPX=n +USE_RESOLV=n + +ifeq ($(USE_RESOLV), y) +#options if you have a bind>=4.9.4 libresolv (or, maybe, glibc) +LDLIBS+=-lresolv +DEFINES+=-DRESOLVE_HOSTNAMES +else #options if you compile with libc5, and without a bind>=4.9.4 libresolv -#LDLIBS= -#ADDLIB=inet_ntop.o inet_pton.o +ADDLIB+=inet_ntop.o inet_pton.o +endif +ifeq ($(USE_DECNET), y) #options for decnet ADDLIB+=dnet_ntop.o dnet_pton.o +DEFINES+=-DWANT_DECNET +endif +ifeq ($(USE_IPX), y) #options for ipx ADDLIB+=ipx_ntop.o ipx_pton.o +DEFINES+=-DWANT_IPX +endif + +ifeq ($(USE_IPV6), y) +#options for ipx +DEFINES+=-DWANT_IPV6 +endif ifeq ($(LIBC_INCLUDE)/socketbits.h,$(wildcard $(LIBC_INCLUDE)/socketbits.h)) ifeq ($(LIBC_INCLUDE)/net/if_packet.h,$(wildcard $(LIBC_INCLUDE)/net/if_packet.h)) @@ -28,7 +52,7 @@ endif CC = gcc -CCOPTS = -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -Werror -g +CCOPTS = -D_GNU_SOURCE -Os -malign-functions=0 -malign-loops=0 -malign-jumps=0 -m386 -Wstrict-prototypes -Wall -Werror CFLAGS = $(CCOPTS) $(GLIBCFIX) -I$(KERNEL_INCLUDE) -I../include $(DEFINES) LDLIBS += -L../lib -lnetlink -lutil @@ -50,6 +74,17 @@ if [ ! -r $(KERNEL_INCLUDE)/linux/autoconf.h ]; then \ echo "Please, Compile the kernel first"; false; fi endif + +install: all + install -m 0755 -d $(DESTDIR)$(SBINDIR) + install -m 0755 -d $(DESTDIR)$(CONFDIR) + install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples + install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples/diffserv + install -m 0755 -s ip/ip ip/rtmon ip/rtacct tc/tc $(DESTDIR)$(SBINDIR) + install -m 0755 ip/routel ip/routef $(DESTDIR)$(SBINDIR) + install -m 0644 $(shell echo etc/iproute2/*) $(DESTDIR)$(CONFDIR) + install -m 0644 README.iproute2+tc $(shell find examples -type f -maxdepth 1) $(DESTDIR)$(DOCDIR)/examples + install -m 0644 $(shell echo examples/diffserv/*) $(DESTDIR)$(DOCDIR)/examples/diffserv clean: for i in $(SUBDIRS) doc; \ diff -urN iproute2-2.4.7-010824/ip/ip.c iproute2-2.4.7-wt011202/ip/ip.c --- iproute2-2.4.7-010824/ip/ip.c Sun Apr 16 19:42:50 2000 +++ iproute2-2.4.7-wt011202/ip/ip.c Sun Dec 2 16:48:05 2001 @@ -42,7 +42,17 @@ "where OBJECT := { link | addr | route | rule | neigh | tunnel |\n" " maddr | mroute | monitor }\n" " OPTIONS := { -V[ersion] | -s[tatistics] | -r[esolve] |\n" -" -f[amily] { inet | inet6 | ipx | dnet | link } | -o[neline] }\n"); +" -f[amily] { inet |" +#ifdef WANT_IPV6 +" inet6 |" +#endif +#ifdef WANT_IPX +" ipx |" +#endif +#ifdef WANT_DECNET +" dnet |" +#endif +" link } | -o[neline] }\n"); exit(-1); } @@ -73,28 +83,40 @@ usage(); if (strcmp(argv[1], "inet") == 0) preferred_family = AF_INET; +#ifdef WANT_IPV6 else if (strcmp(argv[1], "inet6") == 0) preferred_family = AF_INET6; +#endif +#ifdef WANT_DECNET else if (strcmp(argv[1], "dnet") == 0) preferred_family = AF_DECnet; +#endif else if (strcmp(argv[1], "link") == 0) preferred_family = AF_PACKET; +#ifdef WANT_IPX else if (strcmp(argv[1], "ipx") == 0) preferred_family = AF_IPX; +#endif else if (strcmp(argv[1], "help") == 0) usage(); else invarg(argv[1], "invalid protocol family"); } else if (strcmp(opt, "-4") == 0) { preferred_family = AF_INET; +#ifdef WANT_IPV6 } else if (strcmp(opt, "-6") == 0) { preferred_family = AF_INET6; +#endif } else if (strcmp(opt, "-0") == 0) { preferred_family = AF_PACKET; +#ifdef WANT_IPX } else if (strcmp(opt, "-I") == 0) { preferred_family = AF_IPX; +#endif +#ifdef WANT_DECNET } else if (strcmp(opt, "-D") == 0) { preferred_family = AF_DECnet; +#endif } else if (matches(opt, "-stats") == 0 || matches(opt, "-statistics") == 0) { ++show_stats; diff -urN iproute2-2.4.7-010824/ip/ipaddress.c iproute2-2.4.7-wt011202/ip/ipaddress.c --- iproute2-2.4.7-010824/ip/ipaddress.c Thu Aug 23 06:07:46 2001 +++ iproute2-2.4.7-wt011202/ip/ipaddress.c Sun Dec 2 16:48:06 2001 @@ -60,7 +60,7 @@ if (do_link) { iplink_usage(); } - fprintf(stderr, "Usage: ip addr {add|del} IFADDR dev STRING\n"); + fprintf(stderr, "Usage: ip addr {add|del} IFADDR dev STRING [ hidden ]\n"); fprintf(stderr, " ip addr {show|flush} [ dev STRING ] [ scope SCOPE-ID ]\n"); fprintf(stderr, " [ to PREFIX ] [ FLAG-LIST ] [ label PATTERN ]\n"); fprintf(stderr, "IFADDR := PREFIX | ADDR peer PREFIX\n"); @@ -69,7 +69,7 @@ fprintf(stderr, "SCOPE-ID := [ host | link | global | NUMBER ]\n"); fprintf(stderr, "FLAG-LIST := [ FLAG-LIST ] FLAG\n"); fprintf(stderr, "FLAG := [ permanent | dynamic | secondary | primary |\n"); - fprintf(stderr, " tentative | deprecated ]\n"); + fprintf(stderr, " tentative | deprecated | hidden ]\n"); exit(-1); } @@ -353,12 +353,18 @@ fprintf(fp, "%u: %s", ifa->ifa_index, ll_index_to_name(ifa->ifa_index)); if (ifa->ifa_family == AF_INET) fprintf(fp, " inet "); +#ifdef WANT_IPV6 else if (ifa->ifa_family == AF_INET6) fprintf(fp, " inet6 "); +#endif +#ifdef WANT_DECNET else if (ifa->ifa_family == AF_DECnet) fprintf(fp, " dnet "); +#endif +#ifdef WANT_IPX else if (ifa->ifa_family == AF_IPX) fprintf(fp, " ipx "); +#endif else fprintf(fp, " family %d ", ifa->ifa_family); @@ -400,6 +406,12 @@ ifa->ifa_flags &= ~IFA_F_SECONDARY; fprintf(fp, "secondary "); } +#ifdef IFA_F_HIDDEN + if (ifa->ifa_flags&IFA_F_HIDDEN) { + ifa->ifa_flags &= ~IFA_F_HIDDEN; + fprintf(fp, "hidden "); + } +#endif if (ifa->ifa_flags&IFA_F_TENTATIVE) { ifa->ifa_flags &= ~IFA_F_TENTATIVE; fprintf(fp, "tentative "); @@ -541,6 +553,11 @@ } else if (strcmp(*argv, "primary") == 0) { filter.flags &= ~IFA_F_SECONDARY; filter.flagmask |= IFA_F_SECONDARY; +#ifdef IFA_F_HIDDEN + } else if (strcmp(*argv, "hidden") == 0) { + filter.flags &= ~IFA_F_HIDDEN; + filter.flagmask |= IFA_F_HIDDEN; +#endif } else if (strcmp(*argv, "tentative") == 0) { filter.flags |= IFA_F_TENTATIVE; filter.flagmask |= IFA_F_TENTATIVE; @@ -803,6 +820,11 @@ } else if (strcmp(*argv, "dev") == 0) { NEXT_ARG(); d = *argv; + } else if (strcmp(*argv, "hidden") == 0 || + strcmp(*argv, "noarp") == 0) { +#ifdef IFA_F_HIDDEN + req.ifa.ifa_flags |= IFA_F_HIDDEN; +#endif } else if (strcmp(*argv, "label") == 0) { NEXT_ARG(); l = *argv; diff -urN iproute2-2.4.7-010824/ip/ipmaddr.c iproute2-2.4.7-wt011202/ip/ipmaddr.c --- iproute2-2.4.7-010824/ip/ipmaddr.c Sun Apr 16 19:42:51 2000 +++ iproute2-2.4.7-wt011202/ip/ipmaddr.c Sun Dec 2 16:48:05 2001 @@ -153,7 +153,7 @@ fclose(fp); } - +#ifdef WANT_IPV6 void read_igmp6(struct ma_info **result_p) { char buf[256]; @@ -188,6 +188,7 @@ } fclose(fp); } +#endif static void print_maddr(FILE *fp, struct ma_info *list) { @@ -204,9 +205,11 @@ case AF_INET: fprintf(fp, "inet "); break; +#ifdef WANT_IPV6 case AF_INET6: fprintf(fp, "inet6 "); break; +#endif default: fprintf(fp, "family %d ", list->addr.family); break; @@ -264,8 +267,10 @@ read_dev_mcast(&list); if (!filter.family || filter.family == AF_INET) read_igmp(&list); +#ifdef WANT_IPV6 if (!filter.family || filter.family == AF_INET6) read_igmp6(&list); +#endif print_mlist(stdout, list); return 0; } diff -urN iproute2-2.4.7-010824/ip/ipmonitor.c iproute2-2.4.7-wt011202/ip/ipmonitor.c --- iproute2-2.4.7-010824/ip/ipmonitor.c Thu Aug 2 05:23:25 2001 +++ iproute2-2.4.7-wt011202/ip/ipmonitor.c Sun Dec 2 16:48:05 2001 @@ -120,14 +120,18 @@ if (laddr) { if (!preferred_family || preferred_family == AF_INET) groups |= RTMGRP_IPV4_IFADDR; +#ifdef WANT_IPV6 if (!preferred_family || preferred_family == AF_INET6) groups |= RTMGRP_IPV6_IFADDR; +#endif } if (lroute) { if (!preferred_family || preferred_family == AF_INET) groups |= RTMGRP_IPV4_ROUTE; +#ifdef WANT_IPV6 if (!preferred_family || preferred_family == AF_INET6) groups |= RTMGRP_IPV6_ROUTE; +#endif } if (file) { diff -urN iproute2-2.4.7-010824/ip/iproute.c iproute2-2.4.7-wt011202/ip/iproute.c --- iproute2-2.4.7-010824/ip/iproute.c Mon Aug 6 02:31:52 2001 +++ iproute2-2.4.7-wt011202/ip/iproute.c Sun Dec 2 16:48:06 2001 @@ -62,7 +62,7 @@ fprintf(stderr, " unreachable | prohibit | blackhole | nat ]\n"); fprintf(stderr, "TABLE_ID := [ local | main | default | all | NUMBER ]\n"); fprintf(stderr, "SCOPE := [ host | link | global | NUMBER ]\n"); - fprintf(stderr, "FLAGS := [ equalize ]\n"); + fprintf(stderr, "FLAGS := [ equalize | noarp ]\n"); fprintf(stderr, "NHFLAGS := [ onlink | pervasive ]\n"); fprintf(stderr, "RTPROTO := [ kernel | boot | static | NUMBER ]\n"); exit(-1); @@ -129,16 +129,21 @@ fprintf(stderr, "BUG: wrong nlmsg len %d\n", len); return -1; } - +#ifdef WANT_IPV6 if (r->rtm_family == AF_INET6) host_len = 128; +#endif else if (r->rtm_family == AF_INET) host_len = 32; +#ifdef WANT_DECNET else if (r->rtm_family == AF_DECnet) host_len = 16; +#endif +#ifdef WANT_IPX else if (r->rtm_family == AF_IPX) host_len = 80; - +#endif +#ifdef WANT_IPV6 if (r->rtm_family == AF_INET6) { if (filter.tb) { if (filter.tb < 0) { @@ -158,7 +163,9 @@ } } } - } else { + } else +#endif + { if (filter.tb > 0 && filter.tb != r->rtm_table) return 0; } @@ -253,6 +260,7 @@ if ((oif^filter.oif)&filter.oifmask) return 0; } +#ifdef WANT_IPV6 if (filter.flushb && r->rtm_family == AF_INET6 && r->rtm_dst_len == 0 && @@ -260,7 +268,7 @@ tb[RTA_PRIORITY] && *(int*)RTA_DATA(tb[RTA_PRIORITY]) == -1) return 0; - +#endif if (filter.flushb) { struct nlmsghdr *fn; if (NLMSG_ALIGN(filter.flushp) + n->nlmsg_len > filter.flushe) { @@ -363,6 +371,10 @@ fprintf(fp, "pervasive "); if (r->rtm_flags & RTM_F_EQUALIZE) fprintf(fp, "equalize "); +#ifdef RTM_F_NOARP + if (r->rtm_flags & RTM_F_NOARP) + fprintf(fp, "noarp "); +#endif if (r->rtm_flags & RTM_F_NOTIFY) fprintf(fp, "notify "); @@ -400,6 +412,9 @@ PRTFL(REDIRECTED, "redirected"); PRTFL(DOREDIRECT, "redirect"); PRTFL(FAST, "fastroute"); +#ifdef RTCF_NOARP + PRTFL(NOARP, "noarp"); +#endif PRTFL(NOTIFY, "notify"); PRTFL(TPROXY, "proxy"); #ifdef RTCF_EQUALIZE @@ -431,6 +446,7 @@ fprintf(fp, " ts 0x%x tsage %dsec", ci->rta_ts, ci->rta_tsage); #endif } +#ifdef WANT_IPV6 } else if (r->rtm_family == AF_INET6) { struct rta_cacheinfo *ci = NULL; if (tb[RTA_CACHEINFO]) @@ -457,6 +473,7 @@ if (ci->rta_error != 0) fprintf(fp, " error %d", ci->rta_error); } +#endif } if (tb[RTA_METRICS]) { int i; @@ -811,6 +828,10 @@ } else if (matches(*argv, "equalize") == 0 || strcmp(*argv, "eql") == 0) { req.r.rtm_flags |= RTM_F_EQUALIZE; +#ifdef RTM_F_NOARP + } else if (matches(*argv, "noarp") == 0) { + req.r.rtm_flags |= RTM_F_NOARP; +#endif } else if (strcmp(*argv, "nexthop") == 0) { nhs_ok = 1; break; @@ -1135,7 +1156,10 @@ char flushb[4096-512]; if (filter.tb == -1) { - if (do_ipv6 != AF_INET6) { +#ifdef WANT_IPV6 + if (do_ipv6 != AF_INET6) +#endif + { iproute_flush_cache(); if (show_stats) printf("*** IPv4 routing cache is flushed.\n"); @@ -1161,7 +1185,11 @@ } if (filter.flushed == 0) { if (round == 0) { - if (filter.tb != -1 || do_ipv6 == AF_INET6) + if (filter.tb != -1 +#ifdef WANT_IPV6 + || do_ipv6 == AF_INET6 +#endif + ) fprintf(stderr, "Nothing to flush.\n"); } else if (show_stats) printf("*** Flush is complete after %d round%s ***\n", round, round>1?"s":""); diff -urN iproute2-2.4.7-010824/ip/iprule.c iproute2-2.4.7-wt011202/ip/iprule.c --- iproute2-2.4.7-010824/ip/iprule.c Thu Aug 2 05:43:29 2001 +++ iproute2-2.4.7-wt011202/ip/iprule.c Sun Dec 2 16:48:05 2001 @@ -64,12 +64,18 @@ if (r->rtm_family == AF_INET) host_len = 32; +#ifdef WANT_IPV6 else if (r->rtm_family == AF_INET6) host_len = 128; +#endif +#ifdef WANT_DECNET else if (r->rtm_family == AF_DECnet) host_len = 16; +#endif +#ifdef WANT_IPX else if (r->rtm_family == AF_IPX) host_len = 80; +#endif if (tb[RTA_PRIORITY]) fprintf(fp, "%u:\t", *(unsigned*)RTA_DATA(tb[RTA_PRIORITY])); diff -urN iproute2-2.4.7-010824/ip/rtmon.c iproute2-2.4.7-wt011202/ip/rtmon.c --- iproute2-2.4.7-010824/ip/rtmon.c Sun Apr 16 19:42:51 2000 +++ iproute2-2.4.7-wt011202/ip/rtmon.c Sun Dec 2 16:48:05 2001 @@ -83,10 +83,12 @@ usage(); if (strcmp(argv[1], "inet") == 0) family = AF_INET; +#ifdef WANT_IPV6 else if (strcmp(argv[1], "inet6") == 0) family = AF_INET6; +#endif else if (strcmp(argv[1], "link") == 0) - family = AF_INET6; + family = AF_PACKET; else if (strcmp(argv[1], "help") == 0) usage(); else { @@ -95,8 +97,10 @@ } } else if (strcmp(argv[1], "-4") == 0) { family = AF_INET; +#ifdef WANT_IPV6 } else if (strcmp(argv[1], "-6") == 0) { family = AF_INET6; +#endif } else if (strcmp(argv[1], "-0") == 0) { family = AF_PACKET; } else if (matches(argv[1], "-Version") == 0) { @@ -137,14 +141,18 @@ if (laddr) { if (!family || family == AF_INET) groups |= RTMGRP_IPV4_IFADDR; +#ifdef WANT_IPV6 if (!family || family == AF_INET6) groups |= RTMGRP_IPV6_IFADDR; +#endif } if (lroute) { if (!family || family == AF_INET) groups |= RTMGRP_IPV4_ROUTE; +#ifdef WANT_IPV6 if (!family || family == AF_INET6) groups |= RTMGRP_IPV6_ROUTE; +#endif } fp = fopen(file, "w"); diff -urN iproute2-2.4.7-010824/lib/inet_ntop.c iproute2-2.4.7-wt011202/lib/inet_ntop.c --- iproute2-2.4.7-010824/lib/inet_ntop.c Sun Apr 16 19:42:52 2000 +++ iproute2-2.4.7-wt011202/lib/inet_ntop.c Sun Dec 2 16:48:05 2001 @@ -29,7 +29,9 @@ #include #include +#ifndef IN6ADDRSZ #define IN6ADDRSZ sizeof(struct in6_addr) +#endif #ifdef SPRINTF_CHAR # define SPRINTF(x) strlen(sprintf/**/x) diff -urN iproute2-2.4.7-010824/lib/inet_pton.c iproute2-2.4.7-wt011202/lib/inet_pton.c --- iproute2-2.4.7-010824/lib/inet_pton.c Sun Apr 16 19:42:52 2000 +++ iproute2-2.4.7-wt011202/lib/inet_pton.c Sun Dec 2 16:48:06 2001 @@ -28,7 +28,9 @@ #include #include +#ifndef IN6ADDRSZ #define IN6ADDRSZ sizeof(struct in6_addr) +#endif /* * WARNING: Don't even consider trying to compile this on a system where diff -urN iproute2-2.4.7-010824/lib/utils.c iproute2-2.4.7-wt011202/lib/utils.c --- iproute2-2.4.7-010824/lib/utils.c Fri Aug 24 19:09:54 2001 +++ iproute2-2.4.7-wt011202/lib/utils.c Sun Dec 2 16:48:06 2001 @@ -138,14 +138,21 @@ if (strcmp(name, "default") == 0 || strcmp(name, "all") == 0 || strcmp(name, "any") == 0) { +#ifdef WANT_DECNET if (family == AF_DECnet) return -1; +#endif addr->family = family; - addr->bytelen = (family == AF_INET6 ? 16 : 4); + addr->bytelen = ( +#ifdef WANT_IPV6 + family == AF_INET6 ? 16 : +#endif + 4); addr->bitlen = -1; return 0; } +#ifdef WANT_IPV6 if (strchr(name, ':')) { addr->family = AF_INET6; if (family != AF_UNSPEC && family != AF_INET6) @@ -156,7 +163,9 @@ addr->bitlen = -1; return 0; } +#endif +#ifdef WANT_DECNET if (family == AF_DECnet) { struct dn_naddr dna; addr->family = AF_DECnet; @@ -167,6 +176,7 @@ addr->bitlen = -1; return 0; } +#endif addr->family = AF_INET; if (family != AF_UNSPEC && family != AF_INET) @@ -194,8 +204,10 @@ memset(dst, 0, sizeof(*dst)); if (strcmp(arg, "default") == 0 || strcmp(arg, "any") == 0) { +#ifdef WANT_DECNET if (family == AF_DECnet) return -1; +#endif dst->family = family; dst->bytelen = 0; dst->bitlen = 0; @@ -208,12 +220,16 @@ err = get_addr_1(dst, arg, family); if (err == 0) { switch(dst->family) { +#ifdef WANT_IPV6 case AF_INET6: dst->bitlen = 128; break; +#endif +#ifdef WANT_DECNET case AF_DECnet: dst->bitlen = 16; break; +#endif default: case AF_INET: dst->bitlen = 32; @@ -351,16 +367,22 @@ { switch (af) { case AF_INET: +#ifdef WANT_INET6 case AF_INET6: +#endif return inet_ntop(af, addr, buf, buflen); +#ifdef WANT_IPX case AF_IPX: return ipx_ntop(af, addr, buf, buflen); +#endif +#ifdef WANT_DECNET case AF_DECnet: { struct dn_naddr dna = { 2, { 0, 0, }}; memcpy(dna.a_addr, addr, 2); return dnet_ntop(af, &dna, buf, buflen); } +#endif default: return "???"; } @@ -377,13 +399,17 @@ case AF_INET: len = 4; break; +#ifdef WANT_IPV6 case AF_INET6: len = 16; break; +#endif +#ifdef WANT_IPX case AF_IPX: len = 10; break; -#ifdef AF_DECnet +#endif +#ifdef WANT_DECNET /* I see no reasons why gethostbyname may not work for DECnet */ case AF_DECnet: diff -urN iproute2-2.4.7-010824/tc/f_u32.c iproute2-2.4.7-wt011202/tc/f_u32.c --- iproute2-2.4.7-010824/tc/f_u32.c Thu Aug 2 05:10:09 2001 +++ iproute2-2.4.7-wt011202/tc/f_u32.c Sun Dec 2 16:48:06 2001 @@ -32,7 +32,11 @@ fprintf(stderr, "or u32 divisor DIVISOR\n"); fprintf(stderr, "\n"); fprintf(stderr, "Where: SELECTOR := SAMPLE SAMPLE ...\n"); - fprintf(stderr, " SAMPLE := { ip | ip6 | udp | tcp | icmp | u{32|16|8} } SAMPLE_ARGS\n"); + fprintf(stderr, " SAMPLE := { ip |" +#ifdef WANT_IPV6 + " ip6 |" +#endif + " udp | tcp | icmp | u{32|16|8} } SAMPLE_ARGS\n"); fprintf(stderr, " FILTERID := X:Y:Z\n"); } @@ -342,6 +346,7 @@ return res; } +#ifdef WANT_IPV6 static int parse_ip6_addr(int *argc_p, char ***argv_p, struct tc_u32_sel *sel, int off) { int res = -1; @@ -382,6 +387,7 @@ *argv_p = argv; return res; } +#endif static int parse_ip(int *argc_p, char ***argv_p, struct tc_u32_sel *sel) { @@ -471,6 +477,7 @@ return res; } +#ifdef WANT_IPV6 static int parse_ip6(int *argc_p, char ***argv_p, struct tc_u32_sel *sel) { int res = -1; @@ -532,6 +539,7 @@ *argv_p = argv; return res; } +#endif #define parse_tcp parse_udp static int parse_udp(int *argc_p, char ***argv_p, struct tc_u32_sel *sel) @@ -619,11 +627,13 @@ res = parse_ip(&argc, &argv, sel); goto done; } +#ifdef WANT_IPV6 if (matches(*argv, "ip6") == 0) { NEXT_ARG(); res = parse_ip6(&argc, &argv, sel); goto done; } +#endif if (matches(*argv, "udp") == 0) { NEXT_ARG(); res = parse_udp(&argc, &argv, sel);