Skip to content

Commit

Permalink
iproute2: update to 4.6.0
Browse files Browse the repository at this point in the history
add iptables as build dependency since it needs xtables header

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
  • Loading branch information
wongsyrone committed Jun 9, 2016
1 parent 8d2cc28 commit 1d75df6
Show file tree
Hide file tree
Showing 13 changed files with 216 additions and 67 deletions.
10 changes: 6 additions & 4 deletions package/network/utils/iproute2/Makefile
Expand Up @@ -8,13 +8,14 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=iproute2
PKG_VERSION:=4.4.0
PKG_RELEASE:=2
PKG_VERSION:=4.6.0
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
PKG_MD5SUM:=d762653ec3e1ab0d4a9689e169ca184f
PKG_BUILD_PARALLEL:=1
PKG_MD5SUM:=d015e437e4f744d51d3a1a53341826d5
PKG_BUILD_PARALLEL:=0
PKG_BUILD_DEPENDS:=iptables
PKG_LICENSE:=GPL-2.0

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
Expand Down Expand Up @@ -71,6 +72,7 @@ ifeq ($(BUILD_VARIANT),tiny)
endif

define Build/Configure
$(call Build/Configure/Default)
$(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile
$(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
$(PKG_BUILD_DIR)/Makefile
Expand Down
4 changes: 2 additions & 2 deletions package/network/utils/iproute2/patches/006-no_sctp.patch
@@ -1,14 +1,14 @@
--- a/ip/ipxfrm.c
+++ b/ip/ipxfrm.c
@@ -470,7 +470,6 @@ void xfrm_selector_print(struct xfrm_sel
@@ -465,7 +465,6 @@ void xfrm_selector_print(struct xfrm_sel
switch (sel->proto) {
case IPPROTO_TCP:
case IPPROTO_UDP:
- case IPPROTO_SCTP:
case IPPROTO_DCCP:
default: /* XXX */
if (sel->sport_mask)
@@ -1341,7 +1340,6 @@ static int xfrm_selector_upspec_parse(st
@@ -1338,7 +1337,6 @@ static int xfrm_selector_upspec_parse(st
switch (sel->proto) {
case IPPROTO_TCP:
case IPPROTO_UDP:
Expand Down
6 changes: 3 additions & 3 deletions package/network/utils/iproute2/patches/008-no_netem.patch
@@ -1,11 +1,11 @@
--- a/Makefile
+++ b/Makefile
@@ -41,7 +41,7 @@ WFLAGS += -Wmissing-declarations -Wold-s
@@ -42,7 +42,7 @@ WFLAGS += -Wmissing-declarations -Wold-s
CFLAGS := $(WFLAGS) $(CCOPTS) -I../include $(DEFINES) $(CFLAGS)
YACCFLAGS = -d -t -v

-SUBDIRS=lib ip tc bridge misc netem genl tipc man
+SUBDIRS=lib ip tc bridge misc genl tipc man
-SUBDIRS=lib ip tc bridge misc netem genl tipc devlink man
+SUBDIRS=lib ip tc bridge misc genl tipc devlink man

LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a
LDLIBS += $(LIBNETLINK)
142 changes: 95 additions & 47 deletions package/network/utils/iproute2/patches/010-type_fixes.patch
Expand Up @@ -257,44 +257,6 @@
-#endif /* Misc. */
-
-#endif /* netinet/tcp.h */
--- a/include/iptables.h
+++ b/include/iptables.h
@@ -20,7 +20,7 @@ struct ipt_get_revision
{
char name[IPT_FUNCTION_MAXNAMELEN-1];

- u_int8_t revision;
+ uint8_t revision;
};
#endif /* IPT_SO_GET_REVISION_MATCH Old kernel source */

@@ -39,7 +39,7 @@ struct iptables_match
ipt_chainlabel name;

/* Revision of match (0 by default). */
- u_int8_t revision;
+ uint8_t revision;

const char *version;

@@ -92,7 +92,7 @@ struct iptables_target
ipt_chainlabel name;

/* Revision of target (0 by default). */
- u_int8_t revision;
+ uint8_t revision;

const char *version;

@@ -153,7 +153,7 @@ extern char *mask_to_dotted(const struct

extern void parse_hostnetworkmask(const char *name, struct in_addr **addrpp,
struct in_addr *maskp, unsigned int *naddrs);
-extern u_int16_t parse_protocol(const char *s);
+extern uint16_t parse_protocol(const char *s);

extern int do_command(int argc, char *argv[], char **table,
iptc_handle_t *handle);
--- a/lib/dnet_ntop.c
+++ b/lib/dnet_ntop.c
@@ -1,24 +1,25 @@
Expand Down Expand Up @@ -383,14 +345,100 @@
int pos;

pos = dnet_num(src, &area);
--- a/include/libiptc/ipt_kernel_headers.h
+++ b/include/libiptc/ipt_kernel_headers.h
@@ -5,7 +5,7 @@
--- a/include/utils.h
+++ b/include/utils.h
@@ -80,8 +80,8 @@ struct dn_naddr
#define IPX_NODE_LEN 6

#include <limits.h>
struct ipx_addr {
- u_int32_t ipx_net;
- u_int8_t ipx_node[IPX_NODE_LEN];
+ uint32_t ipx_net;
+ uint8_t ipx_node[IPX_NODE_LEN];
};

-#if defined(__GLIBC__) && __GLIBC__ == 2
+#if 1
#include <netinet/ip.h>
#include <netinet/in.h>
#include <netinet/ip_icmp.h>
#ifndef AF_MPLS
--- a/lib/ipx_ntop.c
+++ b/lib/ipx_ntop.c
@@ -5,9 +5,9 @@

#include "utils.h"

-static __inline__ int do_digit(char *str, u_int32_t addr, u_int32_t scale, size_t *pos, size_t len)
+static __inline__ int do_digit(char *str, uint32_t addr, uint32_t scale, size_t *pos, size_t len)
{
- u_int32_t tmp = addr >> (scale * 4);
+ uint32_t tmp = addr >> (scale * 4);

if (*pos == len)
return 1;
--- a/lib/ipx_pton.c
+++ b/lib/ipx_pton.c
@@ -6,7 +6,7 @@

#include "utils.h"

-static u_int32_t hexget(char c)
+static uint32_t hexget(char c)
{
if (c >= 'A' && c <= 'F')
return c - 'A' + 10;
@@ -18,10 +18,10 @@ static u_int32_t hexget(char c)
return 0xf0;
}

-static int ipx_getnet(u_int32_t *net, const char *str)
+static int ipx_getnet(uint32_t *net, const char *str)
{
int i;
- u_int32_t tmp;
+ uint32_t tmp;

for(i = 0; *str && (i < 8); i++) {

@@ -43,19 +43,19 @@ static int ipx_getnet(u_int32_t *net, co
return -1;
}

-static int ipx_getnode(u_int8_t *node, const char *str)
+static int ipx_getnode(uint8_t *node, const char *str)
{
int i;
- u_int32_t tmp;
+ uint32_t tmp;

for(i = 0; i < 6; i++) {
if ((tmp = hexget(*str++)) & 0xf0)
return -1;
- node[i] = (u_int8_t)tmp;
+ node[i] = (uint8_t)tmp;
node[i] <<= 4;
if ((tmp = hexget(*str++)) & 0xf0)
return -1;
- node[i] |= (u_int8_t)tmp;
+ node[i] |= (uint8_t)tmp;
if (*str == ':')
str++;
}
--- a/tc/m_ipt.c
+++ b/tc/m_ipt.c
@@ -349,7 +349,7 @@ struct in_addr *dotted_to_addr(const cha
return &addr;
}

-static void set_revision(char *name, u_int8_t revision)
+static void set_revision(char *name, uint8_t revision)
{
/* Old kernel sources don't have ".revision" field,
* but we stole a byte from name. */
--- a/tc/m_xt_old.c
+++ b/tc/m_xt_old.c
@@ -157,7 +157,7 @@ void exit_error(enum exittype status, co
}

/*XXX: TC_CONFIG_XT_H */
-static void set_revision(char *name, u_int8_t revision)
+static void set_revision(char *name, uint8_t revision)
{
/* Old kernel sources don't have ".revision" field,
* but we stole a byte from name. */
@@ -1,6 +1,6 @@
--- a/tc/q_fifo.c
+++ b/tc/q_fifo.c
@@ -98,5 +98,6 @@ struct qdisc_util pfifo_head_drop_qdisc_
@@ -99,5 +99,6 @@ struct qdisc_util pfifo_head_drop_qdisc_
extern int prio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt);
struct qdisc_util pfifo_fast_qdisc_util = {
.id = "pfifo_fast",
Expand Down
@@ -1,6 +1,6 @@
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,7 @@ HOSTCC = gcc
@@ -35,7 +35,7 @@ HOSTCC = gcc
DEFINES += -D_GNU_SOURCE
# Turn on transparent support for LFS
DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
Expand Down
Expand Up @@ -10,7 +10,7 @@
TCMODULES += q_tbf.o
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -226,6 +226,33 @@ struct tc_sfq_xstats {
@@ -230,6 +230,33 @@ struct tc_sfq_xstats {
__s32 allot;
};

Expand Down
4 changes: 2 additions & 2 deletions package/network/utils/iproute2/patches/300-ip_tiny.patch
Expand Up @@ -70,15 +70,15 @@
};
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -710,6 +710,7 @@ const char *rt_addr_n2a(int af, int len,
@@ -711,6 +711,7 @@ const char *rt_addr_n2a_r(int af, int le
return inet_ntop(af, addr, buf, buflen);
case AF_MPLS:
return mpls_ntop(af, addr, buf, buflen);
+#ifndef IPROUTE2_TINY
case AF_IPX:
return ipx_ntop(af, addr, buf, buflen);
case AF_DECnet:
@@ -718,6 +719,7 @@ const char *rt_addr_n2a(int af, int len,
@@ -719,6 +720,7 @@ const char *rt_addr_n2a_r(int af, int le
memcpy(dna.a_addr, addr, 2);
return dnet_ntop(af, &dna, buf, buflen);
}
Expand Down
Expand Up @@ -23,7 +23,7 @@
#ifndef _LINUX_IN6_H
#define _LINUX_IN6_H

@@ -291,3 +292,4 @@ struct in6_flowlabel_req {
@@ -292,3 +293,4 @@ struct in6_flowlabel_req {
* MRT6_MAX
*/
#endif /* _LINUX_IN6_H */
Expand Down
@@ -1,6 +1,6 @@
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -877,4 +877,55 @@ struct tc_pie_xstats {
@@ -881,4 +881,55 @@ struct tc_pie_xstats {
__u32 maxq; /* maximum queue size */
__u32 ecn_mark; /* packets marked with ecn*/
};
Expand Down Expand Up @@ -58,14 +58,14 @@
#endif
--- a/tc/Makefile
+++ b/tc/Makefile
@@ -64,6 +64,7 @@ TCMODULES += q_codel.o
@@ -65,6 +65,7 @@ TCMODULES += q_codel.o
TCMODULES += q_fq_codel.o
TCMODULES += q_fq.o
TCMODULES += q_pie.o
+TCMODULES += q_cake.o
TCMODULES += q_hhf.o
TCMODULES += q_clsact.o
TCMODULES += e_bpf.o

--- /dev/null
+++ b/tc/q_cake.c
@@ -0,0 +1,598 @@
Expand Down
@@ -0,0 +1,30 @@
From 85b0589b4843c03e8e6fd9416d71ea449a73c5c0 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Thu, 3 Nov 2011 10:46:16 +0100
Subject: [PATCH] make configure cross compile safe

According to Kevin Tian:
Upstream-Status: Pending

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Shane Wang <shane.wang@intel.com>

--- a/configure
+++ b/configure
@@ -2,6 +2,7 @@
# This is not an autoconf generated configure
#
INCLUDE=${1:-"$PWD/include"}
+SYSROOT=$1

# Make a temp directory in build tree.
TMPDIR=$(mktemp -d config.XXXXXX)
@@ -184,7 +185,7 @@ check_ipt_lib_dir()
return
fi

- for dir in /lib /usr/lib /usr/local/lib
+ for dir in $SYSROOT/lib $SYSROOT/usr/lib $SYSROOT/usr/local/lib
do
for file in $dir/{xtables,iptables}/lib*t_*so ; do
if [ -f $file ]; then
@@ -0,0 +1,69 @@
Subject: [PATCH] Avoid in6_addr redefinition

Due to both <netinet/in.h> and <linux/in6.h> being included, the
in6_addr is being redefined: once from the C library headers and once
from the kernel headers. This causes some build failures with for
example the musl C library.

In order to fix this, use just the C library header <netinet/in.h>.
Original patch taken from
http://git.alpinelinux.org/cgit/aports/tree/main/iproute2/musl-fixes.patch.

(Refreshed the patch for 4.6 release)

Upstream-Status: Pending

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Maxin B. John <maxin.john@intel.com>
----
--- a/include/libiptc/ipt_kernel_headers.h
+++ b/include/libiptc/ipt_kernel_headers.h
@@ -6,7 +6,6 @@
#include <limits.h>

#include <netinet/ip.h>
-#include <netinet/in.h>
#include <netinet/ip_icmp.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -4,8 +4,6 @@
#include <linux/types.h>

#include <linux/sysctl.h>
-#include <linux/in.h>
-#include <linux/in6.h>

/* Responses from hook functions. */
#define NF_DROP 0
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -17,7 +17,6 @@

#include <linux/types.h>

-#include <linux/if.h>
#include <linux/netfilter_ipv4.h>

#include <linux/netfilter/x_tables.h>
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -1,7 +1,6 @@
#ifndef _LINUX_XFRM_H
#define _LINUX_XFRM_H

-#include <linux/in6.h>
#include <linux/types.h>

/* All of the structures in this file may not change size as they are
--- a/include/utils.h
+++ b/include/utils.h
@@ -1,6 +1,7 @@
#ifndef __UTILS_H__
#define __UTILS_H__ 1

+#include <sys/param.h> /* MAXPATHLEN */
#include <sys/types.h>
#include <asm/types.h>
#include <resolv.h>

0 comments on commit 1d75df6

Please sign in to comment.