From 580481cd6dd0f9199814974b9b176a6a038c24fb Mon Sep 17 00:00:00 2001
From: Luka Perkov <luka@openwrt.org>
Date: Tue, 14 May 2013 23:49:34 +0000
Subject: [PATCH] iproute2: upgrade to 3.9.0

SVN-Revision: 36638
---
 package/network/utils/iproute2/Makefile       |  8 +--
 .../patches/000-sync_pkt_sched_h.patch        | 36 ------------
 ...2-2.6.11_Config.patch => 001-config.patch} |  0
 ...ipxfrm_no_sctp.patch => 006-no_sctp.patch} |  8 +--
 .../utils/iproute2/patches/008-no_netem.patch |  2 +-
 .../patches/100-allow_pfifo_fast.patch        |  4 --
 .../iproute2/patches/110-extra-ccopts.patch   |  6 +-
 .../iproute2/patches/120-libnetlink-pic.patch |  6 +-
 ...e2-tc_esfq.patch => 200-add-tc_esfq.patch} | 42 ++++++++++++--
 ...nmark.patch => 210-add-act_connmark.patch} |  0
 ...210-build-unbreak-linkage-of-m_xt.so.patch | 58 -------------------
 11 files changed, 50 insertions(+), 120 deletions(-)
 delete mode 100644 package/network/utils/iproute2/patches/000-sync_pkt_sched_h.patch
 rename package/network/utils/iproute2/patches/{001-iproute2-2.6.11_Config.patch => 001-config.patch} (100%)
 rename package/network/utils/iproute2/patches/{002-iproute2-ipxfrm_no_sctp.patch => 006-no_sctp.patch} (63%)
 rename package/network/utils/iproute2/patches/{006-iproute2-tc_esfq.patch => 200-add-tc_esfq.patch} (86%)
 rename package/network/utils/iproute2/patches/{200-act_connmark.patch => 210-add-act_connmark.patch} (100%)
 delete mode 100644 package/network/utils/iproute2/patches/210-build-unbreak-linkage-of-m_xt.so.patch

diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile
index a875ffc76b..8e25f867b2 100644
--- a/package/network/utils/iproute2/Makefile
+++ b/package/network/utils/iproute2/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2010 OpenWrt.org
+# Copyright (C) 2006-2013 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=iproute2
-PKG_VERSION:=3.7.0
-PKG_RELEASE:=2
+PKG_VERSION:=3.9.0
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://kernel.org/pub/linux/utils/net/iproute2/
-PKG_MD5SUM:=47040899f8fa30c8721fc5aec6509b44
+PKG_MD5SUM:=b53376db94c8d66f9d540c69ed84f13b
 PKG_BUILD_PARALLEL:=1
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/iproute2-$(PKG_VERSION)
diff --git a/package/network/utils/iproute2/patches/000-sync_pkt_sched_h.patch b/package/network/utils/iproute2/patches/000-sync_pkt_sched_h.patch
deleted file mode 100644
index b06bc7071e..0000000000
--- a/package/network/utils/iproute2/patches/000-sync_pkt_sched_h.patch
+++ /dev/null
@@ -1,36 +0,0 @@
---- a/include/linux/pkt_sched.h
-+++ b/include/linux/pkt_sched.h
-@@ -214,6 +214,33 @@ struct tc_sfq_xstats {
- 	__s32		allot;
- };
- 
-+/* ESFQ section */
-+
-+enum
-+{
-+        /* traditional */
-+	TCA_SFQ_HASH_CLASSIC,
-+	TCA_SFQ_HASH_DST,
-+	TCA_SFQ_HASH_SRC,
-+	TCA_SFQ_HASH_FWMARK,
-+	/* conntrack */
-+	TCA_SFQ_HASH_CTORIGDST,
-+	TCA_SFQ_HASH_CTORIGSRC,
-+	TCA_SFQ_HASH_CTREPLDST,
-+	TCA_SFQ_HASH_CTREPLSRC,
-+	TCA_SFQ_HASH_CTNATCHG,
-+};
-+
-+struct tc_esfq_qopt
-+{
-+	unsigned	quantum;	/* Bytes per round allocated to flow */
-+	int		perturb_period;	/* Period of hash perturbation */
-+	__u32		limit;		/* Maximal packets in queue */
-+	unsigned	divisor;	/* Hash divisor  */
-+	unsigned	flows;		/* Maximal number of flows  */
-+	unsigned	hash_kind;	/* Hash function to use for flow identification */
-+};
-+
- /* RED section */
- 
- enum {
diff --git a/package/network/utils/iproute2/patches/001-iproute2-2.6.11_Config.patch b/package/network/utils/iproute2/patches/001-config.patch
similarity index 100%
rename from package/network/utils/iproute2/patches/001-iproute2-2.6.11_Config.patch
rename to package/network/utils/iproute2/patches/001-config.patch
diff --git a/package/network/utils/iproute2/patches/002-iproute2-ipxfrm_no_sctp.patch b/package/network/utils/iproute2/patches/006-no_sctp.patch
similarity index 63%
rename from package/network/utils/iproute2/patches/002-iproute2-ipxfrm_no_sctp.patch
rename to package/network/utils/iproute2/patches/006-no_sctp.patch
index 3b1f4d6470..ef642220b3 100644
--- a/package/network/utils/iproute2/patches/002-iproute2-ipxfrm_no_sctp.patch
+++ b/package/network/utils/iproute2/patches/006-no_sctp.patch
@@ -1,10 +1,6 @@
----
- ip/ipxfrm.c |    2 --
- 1 file changed, 2 deletions(-)
-
 --- a/ip/ipxfrm.c
 +++ b/ip/ipxfrm.c
-@@ -468,7 +468,6 @@ void xfrm_selector_print(struct xfrm_sel
+@@ -470,7 +470,6 @@ void xfrm_selector_print(struct xfrm_sel
  	switch (sel->proto) {
  	case IPPROTO_TCP:
  	case IPPROTO_UDP:
@@ -12,7 +8,7 @@
  	case IPPROTO_DCCP:
  	default: /* XXX */
  		if (sel->sport_mask)
-@@ -1263,7 +1262,6 @@ static int xfrm_selector_upspec_parse(st
+@@ -1273,7 +1272,6 @@ static int xfrm_selector_upspec_parse(st
  		switch (sel->proto) {
  		case IPPROTO_TCP:
  		case IPPROTO_UDP:
diff --git a/package/network/utils/iproute2/patches/008-no_netem.patch b/package/network/utils/iproute2/patches/008-no_netem.patch
index a6a74aa809..165ce0c9b9 100644
--- a/package/network/utils/iproute2/patches/008-no_netem.patch
+++ b/package/network/utils/iproute2/patches/008-no_netem.patch
@@ -1,6 +1,6 @@
 --- a/Makefile
 +++ b/Makefile
-@@ -34,7 +34,7 @@ WFLAGS = -Wall -Wstrict-prototypes
+@@ -36,7 +36,7 @@ WFLAGS += -Wmissing-declarations -Wold-s
  CFLAGS = $(WFLAGS) $(CCOPTS) -I../include $(DEFINES)
  YACCFLAGS = -d -t -v
  
diff --git a/package/network/utils/iproute2/patches/100-allow_pfifo_fast.patch b/package/network/utils/iproute2/patches/100-allow_pfifo_fast.patch
index b31d4b745f..ce958a9345 100644
--- a/package/network/utils/iproute2/patches/100-allow_pfifo_fast.patch
+++ b/package/network/utils/iproute2/patches/100-allow_pfifo_fast.patch
@@ -1,7 +1,3 @@
----
- tc/q_fifo.c |    1 +
- 1 file changed, 1 insertion(+)
-
 --- a/tc/q_fifo.c
 +++ b/tc/q_fifo.c
 @@ -98,5 +98,6 @@ struct qdisc_util pfifo_head_drop_qdisc_
diff --git a/package/network/utils/iproute2/patches/110-extra-ccopts.patch b/package/network/utils/iproute2/patches/110-extra-ccopts.patch
index f4ef8d7639..af38fe1989 100644
--- a/package/network/utils/iproute2/patches/110-extra-ccopts.patch
+++ b/package/network/utils/iproute2/patches/110-extra-ccopts.patch
@@ -6,6 +6,6 @@
  DEFINES += -D_GNU_SOURCE
 -CCOPTS = -O2
 +CCOPTS = -O2 $(EXTRA_CCOPTS)
- WFLAGS = -Wall -Wstrict-prototypes
- CFLAGS = $(WFLAGS) $(CCOPTS) -I../include $(DEFINES)
- YACCFLAGS = -d -t -v
+ WFLAGS := -Wall -Wstrict-prototypes -Werror -Wmissing-prototypes
+ WFLAGS += -Wmissing-declarations -Wold-style-definition
+ 
diff --git a/package/network/utils/iproute2/patches/120-libnetlink-pic.patch b/package/network/utils/iproute2/patches/120-libnetlink-pic.patch
index c7b78d0639..3ea7d193b2 100644
--- a/package/network/utils/iproute2/patches/120-libnetlink-pic.patch
+++ b/package/network/utils/iproute2/patches/120-libnetlink-pic.patch
@@ -1,8 +1,10 @@
 --- a/lib/Makefile
 +++ b/lib/Makefile
-@@ -1,4 +1,4 @@
+@@ -1,6 +1,6 @@
+ include ../Config
+ 
 -CFLAGS += -fPIC
-+CFLAGS+=$(FPIC)
++CFLAGS += $(FPIC)
  
  UTILOBJ=utils.o rt_names.o ll_types.o ll_proto.o ll_addr.o inet_proto.o
  
diff --git a/package/network/utils/iproute2/patches/006-iproute2-tc_esfq.patch b/package/network/utils/iproute2/patches/200-add-tc_esfq.patch
similarity index 86%
rename from package/network/utils/iproute2/patches/006-iproute2-tc_esfq.patch
rename to package/network/utils/iproute2/patches/200-add-tc_esfq.patch
index 8016dbb962..df5dc017a2 100644
--- a/package/network/utils/iproute2/patches/006-iproute2-tc_esfq.patch
+++ b/package/network/utils/iproute2/patches/200-add-tc_esfq.patch
@@ -1,9 +1,3 @@
----
- include/linux/pkt_sched.h |   59 +++++++++++++
- tc/Makefile               |    1 
- tc/q_esfq.c               |  200 ++++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 260 insertions(+)
-
 --- a/tc/Makefile
 +++ b/tc/Makefile
 @@ -8,6 +8,7 @@ SHARED_LIBS ?= y
@@ -14,6 +8,42 @@
  TCMODULES += q_red.o
  TCMODULES += q_prio.o
  TCMODULES += q_tbf.o
+--- a/include/linux/pkt_sched.h
++++ b/include/linux/pkt_sched.h
+@@ -214,6 +214,33 @@ struct tc_sfq_xstats {
+ 	__s32		allot;
+ };
+ 
++/* ESFQ section */
++
++enum
++{
++        /* traditional */
++	TCA_SFQ_HASH_CLASSIC,
++	TCA_SFQ_HASH_DST,
++	TCA_SFQ_HASH_SRC,
++	TCA_SFQ_HASH_FWMARK,
++	/* conntrack */
++	TCA_SFQ_HASH_CTORIGDST,
++	TCA_SFQ_HASH_CTORIGSRC,
++	TCA_SFQ_HASH_CTREPLDST,
++	TCA_SFQ_HASH_CTREPLSRC,
++	TCA_SFQ_HASH_CTNATCHG,
++};
++
++struct tc_esfq_qopt
++{
++	unsigned	quantum;	/* Bytes per round allocated to flow */
++	int		perturb_period;	/* Period of hash perturbation */
++	__u32		limit;		/* Maximal packets in queue */
++	unsigned	divisor;	/* Hash divisor  */
++	unsigned	flows;		/* Maximal number of flows  */
++	unsigned	hash_kind;	/* Hash function to use for flow identification */
++};
++
+ /* RED section */
+ 
+ enum {
 --- /dev/null
 +++ b/tc/q_esfq.c
 @@ -0,0 +1,200 @@
diff --git a/package/network/utils/iproute2/patches/200-act_connmark.patch b/package/network/utils/iproute2/patches/210-add-act_connmark.patch
similarity index 100%
rename from package/network/utils/iproute2/patches/200-act_connmark.patch
rename to package/network/utils/iproute2/patches/210-add-act_connmark.patch
diff --git a/package/network/utils/iproute2/patches/210-build-unbreak-linkage-of-m_xt.so.patch b/package/network/utils/iproute2/patches/210-build-unbreak-linkage-of-m_xt.so.patch
deleted file mode 100644
index 7fb2c11b2e..0000000000
--- a/package/network/utils/iproute2/patches/210-build-unbreak-linkage-of-m_xt.so.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 11e8a1034656eba6571401286b99dabbd9842dac Mon Sep 17 00:00:00 2001
-From: Jan Engelhardt <jengelh@inai.de>
-Date: Tue, 18 Dec 2012 09:18:45 -0800
-Subject: [PATCH] build: unbreak linakge of m_xt.so
-
-Commit v3.7.0~10 caused the variable new PKG_CONFIG variable never
-to be present at the time of calling make, leading to tc/m_xt.so
-not linked with -lxtables (result from pkg-config xtables --libs),
-that in turn leading to
-
-tc: symbol lookup error: /usr/lib64/tc//m_xt.so: undefined symbol:
-xtables_init_all
-
-Fixing that.
-
-Signed-off-by: Jan Engelhardt <jengelh@inai.de>
-
-Conflicts:
-	configure
----
- configure | 14 +++++++++++---
- 1 file changed, 11 insertions(+), 3 deletions(-)
-
---- a/configure
-+++ b/configure
-@@ -2,14 +2,20 @@
- # This is not an autconf generated configure
- #
- INCLUDE=${1:-"$PWD/include"}
--: ${PKG_CONFIG:=pkg-config}
--: ${CC=gcc}
--echo "PKG_CONFIG:=${PKG_CONFIG}" >>Config
- 
- # Make a temp directory in build tree.
- TMPDIR=$(mktemp -d config.XXXXXX)
- trap 'status=$?; rm -rf $TMPDIR; exit $status' EXIT HUP INT QUIT TERM
- 
-+check_toolchain()
-+{
-+: ${PKG_CONFIG:=pkg-config}
-+: ${AR=ar}
-+: ${CC=gcc}
-+echo "AR:=${AR}" >>Config
-+echo "CC:=${CC}" >>Config
-+}
-+
- check_atm()
- {
- cat >$TMPDIR/atmtest.c <<EOF
-@@ -224,6 +230,8 @@ rm -f $TMPDIR/ipsettest.c $TMPDIR/ipsett
- }
- 
- echo "# Generated config based on" $INCLUDE >Config
-+echo "PKG_CONFIG:=${PKG_CONFIG}" >>Config
-+check_toolchain
- 
- echo "TC schedulers"
- 
-- 
2.25.1