###############################################################################
name = iproute2
-version = 2.6.39
-release = 2
+version = 3.3.0
+release = 1
groups = Networking/Tools
url = http://www.linuxfoundation.org/en/Net:Iproute2
end
source_dl =
+sources = %{thisapp}.tar.xz
build
requires
bison
db4-devel
flex
+ libnl-devel
+ linux-atm-devel >= 2.5.1
+ iptables-devel
end
prepare_cmds
- sed -i -e "s@DESTDIR=.*@DESTDIR=@" \
- -e "s@/share/@/usr/share/@g" Makefile
+ sed -e "s/_VERSION_/%{version}/" man/man8/ss.8
end
+ export RPM_OPT_FLAGS = %{CFLAGS}
+ export LIBDIR = %{libdir}
+ export IPT_LIB_DIR = %{libdir}/xtables
+
install
- make install DESTDIR=%{BUILDROOT}
- mkdir -pv %{BUILDROOT}/usr/sbin
- mv -v %{BUILDROOT}/sbin/arpd %{BUILDROOT}/usr/sbin
+ # The installation routine that comes with that package
+ # is totally unusable for use, so do it manually.
+
+ mkdir -pv \
+ %{BUILDROOT}%{includedir} \
+ %{BUILDROOT}%{sbindir} \
+ %{BUILDROOT}%{mandir}/man{3,8} \
+ %{BUILDROOT}%{datadir}/tc \
+ %{BUILDROOT}%{libdir}/tc \
+ %{BUILDROOT}%{sysconfdir}/iproute2
+
+ # Install binaries.
+ for bin in genl/genl ip/{ifcfg,ip,routef,routel,rtpr} tc/tc \
+ misc/{arpd,ifstat,lnstat,nstat,rtacct,ss}; do
+ install -v -m 755 ${bin} %{BUILDROOT}%{sbindir}
+ done
+ ln -svf lnstat %{BUILDROOT}%{sbindir}/ctstat
+ ln -svf lnstat %{BUILDROOT}%{sbindir}/rtstat
+
+ # Install libs.
+ for lib in tc/q_atm.so tc/m_xt.so; do
+ install -v -m 755 ${lib} %{BUILDROOT}%{libdir}/tc
+ done
+ ln -svf m_xt.so %{BUILDROOT}%{libdir}/tc/m_ipt.so
+
+ # libnetlink
+ install -v -m 644 include/libnetlink.h %{BUILDROOT}%{includedir}
+ install -v -m 644 lib/libnetlink.a %{BUILDROOT}%{libdir}
+
+ # Install documentation.
+ install -v -m 644 man/man3/*.3 %{BUILDROOT}%{mandir}/man3
+ install -v -m 644 man/man8/*.8 %{BUILDROOT}%{mandir}/man8
+ ln -svf lnstat.8 %{BUILDROOT}%{mandir}/man8/ctstat.8
+ ln -svf lnstat.8 %{BUILDROOT}%{mandir}/man8/rtstat.8
+ ln -svf routel.8 %{BUILDROOT}%{mandir}/man8/routef.8
+
+ for sh in netem/normal.dist netem/pareto.dist netem/paretonormal.dist; do
+ install -v -m 644 ${sh} %{BUILDROOT}%{datadir}/tc
+ done
+
+ # Install configuration.
+ install -v -m 644 etc/iproute2/* %{BUILDROOT}%{sysconfdir}/iproute2
+ end
+
+ # Keep libnetlink.a.
+ keep_libraries
+ %{libdir}/libnetlink.a
end
end
packages
package %{name}
groups += Base
+
+ configfiles = %{sysconfdir}/iproute2
+ end
+
+ package %{name}-devel
+ template DEVEL
end
package %{name}-debuginfo
--- /dev/null
+diff -up iproute2-2.6.29/ip/ipxfrm.c.old iproute2-2.6.29/ip/ipxfrm.c
+--- iproute2-2.6.29/ip/ipxfrm.c.old 2009-03-24 23:15:14.000000000 +0100
++++ iproute2-2.6.29/ip/ipxfrm.c 2009-04-24 09:35:58.203735119 +0200
+@@ -1156,6 +1156,7 @@ static int xfrm_selector_upspec_parse(st
+ case IPPROTO_UDP:
+ case IPPROTO_SCTP:
+ case IPPROTO_DCCP:
++ case IPPROTO_IP: /* to allow shared SA for different protocols */
+ break;
+ default:
+ fprintf(stderr, "\"sport\" and \"dport\" are invalid with proto=%s\n", strxf_proto(sel->proto));
--- /dev/null
+diff -up iproute2-20091009/Makefile.kernel iproute2-20091009/Makefile
+--- iproute2-20091009/Makefile.kernel 2009-09-21 10:26:11.000000000 +0200
++++ iproute2-20091009/Makefile 2009-10-09 12:27:03.687382422 +0200
+@@ -6,6 +6,7 @@ CONFDIR=/etc/iproute2
+ DOCDIR=/share/doc/iproute2
+ MANDIR=/share/man
+ ARPDDIR=/var/lib/arpd
++KERNEL_INCLUDE=/usr/include
+
+ # Path to db_185.h include
+ DBM_INCLUDE:=$(ROOTDIR)/usr/include
--- /dev/null
+diff -up iproute2-2.6.31/Makefile.old iproute2-2.6.31/Makefile
+--- iproute2-2.6.31/Makefile.old 2010-01-04 12:46:47.000000000 +0100
++++ iproute2-2.6.31/Makefile 2010-01-04 12:50:17.396384644 +0100
+@@ -13,7 +13,7 @@ DBM_INCLUDE:=$(ROOTDIR)/usr/include
+
+ SHARED_LIBS = y
+
+-DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\"
++DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\" -DIPT_LIB_DIR=\"$(IPT_LIB_DIR)\"
+ ifneq ($(SHARED_LIBS),y)
+ DEFINES+= -DNO_SHARED_LIBS
+ endif
--- /dev/null
+diff --git a/ip/iproute.c b/ip/iproute.c
+index 711576e..86c7ab7 100644
+--- a/ip/iproute.c
++++ b/ip/iproute.c
+@@ -160,7 +160,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+ if (r->rtm_family == AF_INET6 && table != RT_TABLE_MAIN)
+ ip6_multiple_tables = 1;
+
+- if (filter.cloned == !(r->rtm_flags&RTM_F_CLONED))
++ if (filter.cloned && !(r->rtm_flags&RTM_F_CLONED))
+ return 0;
+
+ if (r->rtm_family == AF_INET6 && !ip6_multiple_tables) {
--- /dev/null
+diff --git a/ip/.link_veth.c.swp b/ip/.link_veth.c.swp
+deleted file mode 100644
+index e3b5480..0000000
+Binary files a/ip/.link_veth.c.swp and /dev/null differ
+diff --git a/ip/link_veth.c b/ip/link_veth.c
+index 3d19b01..eb0f41e 100644
+--- a/ip/link_veth.c
++++ b/ip/link_veth.c
+@@ -27,7 +27,7 @@ static void usage(void)
+ static int veth_parse_opt(struct link_util *lu, int argc, char **argv,
+ struct nlmsghdr *hdr)
+ {
+- char *name, *type, *link, *dev;
++ char *name = NULL, *type = NULL, *link = NULL, *dev = NULL;
+ int err, len;
+ struct rtattr * data;
+ int group;
--- /dev/null
+diff --git a/misc/lnstat.c b/misc/lnstat.c
+index 32ab6a4..431bfc7 100644
+--- a/misc/lnstat.c
++++ b/misc/lnstat.c
+@@ -322,7 +322,7 @@ int main(int argc, char **argv)
+ int i;
+ struct table_hdr *header;
+ case MODE_DUMP:
+- lnstat_dump(stderr, lnstat_files);
++ lnstat_dump(stdout, lnstat_files);
+ break;
+ case MODE_NORMAL:
+
--- /dev/null
+--- iproute2-2.6.35/ip/iproute.c 2010-08-31 13:01:39.151185561 +0200
++++ iproute2-print-route-u32.c 2010-08-31 13:41:04.072928779 +0200
+@@ -368,7 +368,7 @@
+ abuf, sizeof(abuf)));
+ }
+ if (tb[RTA_PRIORITY])
+- fprintf(fp, " metric %d ", *(__u32*)RTA_DATA(tb[RTA_PRIORITY]));
++ fprintf(fp, " metric %u ", *(__u32*)RTA_DATA(tb[RTA_PRIORITY]));
+ if (r->rtm_flags & RTNH_F_DEAD)
+ fprintf(fp, "dead ");
+ if (r->rtm_flags & RTNH_F_ONLINK)
+@@ -487,7 +487,7 @@
+ if (i < sizeof(mx_names)/sizeof(char*) && mx_names[i])
+ fprintf(fp, " %s", mx_names[i]);
+ else
+- fprintf(fp, " metric %d", i);
++ fprintf(fp, " metric %u", i);
+ if (mxlock & (1<<i))
+ fprintf(fp, " lock");
+
--- /dev/null
+diff -up iproute-2.6.29/iproute2-2.6.29/tc/tc_util.c.movelib iproute-2.6.29/iproute2-2.6.29/tc/tc_util.c
+--- iproute2-2.6.29/tc/tc_util.c.movelib 2009-01-15 21:25:04.000000000 +0100
++++ iproute2-2.6.29/tc/tc_util.c 2009-02-04 08:58:36.000000000 +0100
+@@ -24,8 +24,8 @@
+ #include "utils.h"
+ #include "tc_util.h"
+
+-#ifndef LIBDIR
+-#define LIBDIR "/usr/lib/"
++#ifndef SHAREDIR
++#define SHAREDIR "/usr/share/"
+ #endif
+
+ const char *get_tc_lib(void)
+@@ -34,7 +34,7 @@ const char *get_tc_lib(void)
+
+ lib_dir = getenv("TC_LIB_DIR");
+ if (!lib_dir)
+- lib_dir = LIBDIR "/tc/";
++ lib_dir = SHAREDIR "/tc/";
+
+ return lib_dir;
+ }
--- /dev/null
+diff -up iproute2-2.6.29/iproute2-2.6.29/Makefile.opt iproute2-2.6.29/iproute2-2.6.29/Makefile
+--- iproute2-2.6.29/Makefile.opt 2008-08-12 14:19:58.000000000 +0200
++++ iproute2-2.6.29/Makefile 2008-08-12 14:21:42.000000000 +0200
+@@ -22,7 +22,7 @@ ADDLIB+=ipx_ntop.o ipx_pton.o
+
+ CC = gcc
+ HOSTCC = gcc
+-CCOPTS = -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall
++CCOPTS = -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall $(RPM_OPT_FLAGS)
+ CFLAGS = $(CCOPTS) -I../include $(DEFINES)
+ YACCFLAGS = -d -t -v
+
--- /dev/null
+diff -up iproute2-2.6.29/man/man8/cbq.8.man iproute2-2.6.29/man/man8/cbq.8
+--- iproute2-2.6.29/man/man8/cbq.8.man 2009-09-24 14:05:44.868922557 +0200
++++ iproute2-2.6.29/man/man8/cbq.8 2009-09-24 14:05:24.760143753 +0200
+@@ -0,0 +1 @@
++.so man8/tc-cbq.8
+\ No newline at end of file
+diff -up /dev/null iproute2-2.6.29/man/man8/ifcfg.8
+--- /dev/null 2009-09-22 09:26:40.270218984 +0200
++++ iproute2-2.6.29/man/man8/ifcfg.8 2009-09-24 14:03:05.415151874 +0200
+@@ -0,0 +1,57 @@
++.TH IFCFG 8 "September 24 2009" "iproute2" "Linux"
++.SH NAME
++ifcfg \- simplistic script which replaces ifconfig IP managment
++.SH SYNOPSIS
++.ad l
++.in +8
++.ti -8
++.B ifcfg
++.RI "[ " DEVICE " [ " :ALIAS: " ] ] [ " command " ] " ADDRESS " [ " LENGTH " ] [ " PEER " ] "
++.sp
++
++.SH DESCRIPTION
++This manual page documents briefly the
++.B ifcfg
++command.
++.PP
++This is a simplistic script replacing one option of
++.B ifconfig
++, namely, IP address management. It not only adds
++addresses, but also carries out Duplicate Address Detection RFC-DHCP,
++sends unsolicited ARP to update the caches of other hosts sharing
++the interface, adds some control routes and restarts Router Discovery
++when it is necessary.
++
++I strongly recommend using it
++.RI instead
++of
++.RI ifconfig
++both on hosts and on routers.
++
++.SH IFCONFIG - COMMAND SYNTAX
++
++.SS
++.TP
++.B DEVICE
++- it may have alias, suffix, separated by colon.
++
++.TP
++.B command
++- add, delete or stop.
++
++.TP
++.B address
++- optionally followed by prefix length.
++
++.TP
++.B peer
++- optional peer address for pointpoint interfaces.
++
++.SH EXAMPLE
++.nf ifcfg eth0 193.233.7.90/24
++.fi
++This function determines, whether this is router or host.
++It returns 0, if the host is apparently not router.
++
++.SH SEE ALSO
++.BR ip-cref.dvi
+diff -up /dev/null iproute2-2.6.29/man/man8/nstat.8
+--- /dev/null 2009-09-22 09:26:40.270218984 +0200
++++ iproute2-2.6.29/man/man8/nstat.8 2009-09-24 14:03:05.416161849 +0200
+@@ -0,0 +1 @@
++.so man8/rtacct.8
+\ No newline at end of file
+--- iproute2-2.6.35/man/man8/ss.8 2010-08-04 19:45:59.000000000 +0200
++++ iproute2-2.6.35/man/man8/ss.8.new 2010-10-11 14:47:06.084216018 +0200
+@@ -114,7 +114,7 @@
+ List all the tcp sockets in state FIN-WAIT-1 for our apache to network 193.233.7/24 and look at their timers.
+ .SH SEE ALSO
+ .BR ip (8),
+-.BR /usr/share/doc/iproute-doc/ss.html " (package iprouteĀdoc)"
++.BR /usr/share/doc/iproute-doc-_VERSION_/ss.ps " (package iproute-doc)"
+ .SH AUTHOR
+ .I ss
+ was written by Alexey Kuznetosv, <kuznet@ms2.inr.ac.ru>.