Accepting request 17722 from network:utilities
Copy from network:utilities/iproute2 based on submit request 17722 from user adrianSuSE OBS-URL: https://build.opensuse.org/request/show/17722 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/iproute2?expand=0&rev=20
This commit is contained in:
parent
8bc40918bb
commit
57ce5340c3
@ -1,47 +0,0 @@
|
||||
diff -Naurp iproute2-2.6.25/include/utils.h iproute2-2.6.25.patched/include/utils.h
|
||||
--- iproute2-2.6.25/include/utils.h 2008-04-17 10:12:54.000000000 -0700
|
||||
+++ iproute2-2.6.25.patched/include/utils.h 2008-12-09 12:43:53.000000000 -0800
|
||||
@@ -46,7 +46,7 @@ typedef struct
|
||||
__u8 bytelen;
|
||||
__s16 bitlen;
|
||||
__u32 flags;
|
||||
- __u32 data[4];
|
||||
+ __u32 data[8];
|
||||
} inet_prefix;
|
||||
|
||||
#define PREFIXLEN_SPECIFIED 1
|
||||
diff -Naurp iproute2-2.6.25/ip/ipmaddr.c iproute2-2.6.25.patched/ip/ipmaddr.c
|
||||
--- iproute2-2.6.25/ip/ipmaddr.c 2008-12-09 12:41:58.000000000 -0800
|
||||
+++ iproute2-2.6.25.patched/ip/ipmaddr.c 2008-12-09 12:43:53.000000000 -0800
|
||||
@@ -43,11 +43,11 @@ static void usage(void)
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
-static int parse_hex(char *str, unsigned char *addr)
|
||||
+static int parse_hex(char *str, unsigned char *addr, size_t size)
|
||||
{
|
||||
int len=0;
|
||||
|
||||
- while (*str) {
|
||||
+ while (*str && (len < 2 * size)) {
|
||||
int tmp;
|
||||
if (str[1] == 0)
|
||||
return -1;
|
||||
@@ -104,7 +104,7 @@ void read_dev_mcast(struct ma_info **res
|
||||
|
||||
m.addr.family = AF_PACKET;
|
||||
|
||||
- len = parse_hex(hexa, (unsigned char*)&m.addr.data);
|
||||
+ len = parse_hex(hexa, (unsigned char*)&m.addr.data, sizeof (m.addr.data));
|
||||
if (len >= 0) {
|
||||
struct ma_info *ma = malloc(sizeof(m));
|
||||
|
||||
@@ -177,7 +177,7 @@ void read_igmp6(struct ma_info **result_
|
||||
|
||||
m.addr.family = AF_INET6;
|
||||
|
||||
- len = parse_hex(hexa, (unsigned char*)&m.addr.data);
|
||||
+ len = parse_hex(hexa, (unsigned char*)&m.addr.data, sizeof (m.addr.data));
|
||||
if (len >= 0) {
|
||||
struct ma_info *ma = malloc(sizeof(m));
|
||||
|
@ -1,90 +0,0 @@
|
||||
--- Makefile
|
||||
+++ Makefile 2008/05/13 08:16:28
|
||||
@@ -1,5 +1,7 @@
|
||||
DESTDIR=
|
||||
SBINDIR=/usr/sbin
|
||||
+LIBDIR=/usr/lib
|
||||
+VARLIB=/var/lib
|
||||
CONFDIR=/etc/iproute2
|
||||
DOCDIR=/usr/share/doc/iproute2
|
||||
MANDIR=/usr/share/man
|
||||
@@ -22,7 +24,7 @@
|
||||
CC = gcc
|
||||
HOSTCC = gcc
|
||||
CCOPTS = -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall
|
||||
-CFLAGS = $(CCOPTS) -I../include $(DEFINES)
|
||||
+CFLAGS = -DLIBDIR=\"$(LIBDIR)\" -DVARLIB=\"$(VARLIB)\" $(CCOPTS) -I../include $(DEFINES)
|
||||
YACCFLAGS = -d -t -v
|
||||
|
||||
LDLIBS += -L../lib -lnetlink -lutil
|
||||
--- include/iptables.h
|
||||
+++ include/iptables.h 2008/05/13 08:14:15
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "libiptc/libiptc.h"
|
||||
|
||||
#ifndef IPT_LIB_DIR
|
||||
-#define IPT_LIB_DIR "/usr/local/lib/iptables"
|
||||
+#define IPT_LIB_DIR LIBDIR
|
||||
#endif
|
||||
|
||||
#ifndef IPPROTO_SCTP
|
||||
--- misc/arpd.c
|
||||
+++ misc/arpd.c 2008/05/13 08:17:25
|
||||
@@ -40,7 +40,7 @@
|
||||
int resolve_hosts;
|
||||
|
||||
DB *dbase;
|
||||
-char *dbname = "/var/lib/arpd/arpd.db";
|
||||
+char *dbname = VARLIB "/arpd/arpd.db";
|
||||
|
||||
int ifnum;
|
||||
int *ifvec;
|
||||
--- netem/Makefile
|
||||
+++ netem/Makefile 2008/05/13 08:18:35
|
||||
@@ -4,6 +4,8 @@
|
||||
HOSTCC ?= $(CC)
|
||||
LDLIBS += -lm
|
||||
|
||||
+LIBDIR = /usr/lib
|
||||
+
|
||||
all: $(DISTGEN) $(DISTDATA)
|
||||
|
||||
$(DISTGEN):
|
||||
@@ -19,9 +21,9 @@
|
||||
$(HOSTCC) $(CCOPTS) -I../include -o $@ $@.c -lm
|
||||
|
||||
install: all
|
||||
- mkdir -p $(DESTDIR)/usr/lib/tc
|
||||
+ mkdir -p $(DESTDIR)/$(LIBDIR)/tc
|
||||
for i in $(DISTDATA); \
|
||||
- do install -m 755 $$i $(DESTDIR)/usr/lib/tc; \
|
||||
+ do install -m 755 $$i $(DESTDIR)/$(LIBDIR)/tc; \
|
||||
done
|
||||
|
||||
clean:
|
||||
--- tc/Makefile
|
||||
+++ tc/Makefile 2008/05/13 08:19:22
|
||||
@@ -72,10 +72,10 @@
|
||||
$(AR) rcs $@ $(TCLIB)
|
||||
|
||||
install: all
|
||||
- mkdir -p $(DESTDIR)/usr/lib/tc
|
||||
+ mkdir -p $(DESTDIR)/$(LIBDIR)/tc
|
||||
install -m 0755 tc $(DESTDIR)$(SBINDIR)
|
||||
for i in $(TCSO); \
|
||||
- do install -m 755 $$i $(DESTDIR)/usr/lib/tc; \
|
||||
+ do install -m 755 -s $$i $(DESTDIR)/$(LIBDIR)/tc; \
|
||||
done
|
||||
|
||||
clean:
|
||||
--- tc/tc_util.c
|
||||
+++ tc/tc_util.c 2008/05/13 08:20:15
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
lib_dir = getenv("TC_LIB_DIR");
|
||||
if (!lib_dir)
|
||||
- lib_dir = "/usr/lib/tc";
|
||||
+ lib_dir = LIBDIR "/tc";
|
||||
|
||||
return lib_dir;
|
||||
}
|
@ -1,281 +0,0 @@
|
||||
IPROUTE: add support for skbedit action
|
||||
|
||||
From: Alexander Duyck <alexander.h.duyck@intel.com>
|
||||
|
||||
Add support for skbedit action.
|
||||
Provides ability to edit queue_mapping field
|
||||
Provides ability to edit priority field
|
||||
|
||||
usage: action skbedit [queue_mapping QUEUE_MAPPING] [priority PRIORITY]
|
||||
at least one option must be select, or both at the same time
|
||||
|
||||
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
|
||||
---
|
||||
|
||||
include/linux/tc_act/tc_skbedit.h | 43 ++++++++
|
||||
tc/Makefile | 1
|
||||
tc/m_skbedit.c | 192 +++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 236 insertions(+), 0 deletions(-)
|
||||
create mode 100644 include/linux/tc_act/tc_skbedit.h
|
||||
create mode 100644 tc/m_skbedit.c
|
||||
|
||||
|
||||
diff --git a/include/linux/tc_act/tc_skbedit.h b/include/linux/tc_act/tc_skbedit.h
|
||||
new file mode 100644
|
||||
index 0000000..98311f0
|
||||
--- /dev/null
|
||||
+++ b/include/linux/tc_act/tc_skbedit.h
|
||||
@@ -0,0 +1,43 @@
|
||||
+/* Copyright (c) 2008, Intel Corporation.
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify it
|
||||
+ * under the terms and conditions of the GNU General Public License,
|
||||
+ * version 2, as published by the Free Software Foundation.
|
||||
+ *
|
||||
+ * This program is distributed in the hope it will be useful, but WITHOUT
|
||||
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
+ * more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License along with
|
||||
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
|
||||
+ *
|
||||
+ * Author: Alexander Duyck <alexander.h.duyck@intel.com>
|
||||
+ */
|
||||
+
|
||||
+#ifndef __LINUX_TC_SKBEDIT_H
|
||||
+#define __LINUX_TC_SKBEDIT_H
|
||||
+
|
||||
+#include <linux/pkt_cls.h>
|
||||
+
|
||||
+#define TCA_ACT_SKBEDIT 11
|
||||
+
|
||||
+#define SKBEDIT_F_PRIORITY 0x1
|
||||
+#define SKBEDIT_F_QUEUE_MAPPING 0x2
|
||||
+
|
||||
+struct tc_skbedit {
|
||||
+ tc_gen;
|
||||
+};
|
||||
+
|
||||
+enum {
|
||||
+ TCA_SKBEDIT_UNSPEC,
|
||||
+ TCA_SKBEDIT_TM,
|
||||
+ TCA_SKBEDIT_PARMS,
|
||||
+ TCA_SKBEDIT_PRIORITY,
|
||||
+ TCA_SKBEDIT_QUEUE_MAPPING,
|
||||
+ __TCA_SKBEDIT_MAX
|
||||
+};
|
||||
+#define TCA_SKBEDIT_MAX (__TCA_SKBEDIT_MAX - 1)
|
||||
+
|
||||
+#endif
|
||||
diff --git a/tc/Makefile b/tc/Makefile
|
||||
index 4116983..1b4169d 100644
|
||||
--- a/tc/Makefile
|
||||
+++ b/tc/Makefile
|
||||
@@ -30,6 +30,7 @@ TCMODULES += m_mirred.o
|
||||
TCMODULES += m_ipt.o
|
||||
TCMODULES += m_nat.o
|
||||
TCMODULES += m_pedit.o
|
||||
+TCMODULES += m_skbedit.o
|
||||
TCMODULES += p_ip.o
|
||||
TCMODULES += p_icmp.o
|
||||
TCMODULES += p_tcp.o
|
||||
diff --git a/tc/m_skbedit.c b/tc/m_skbedit.c
|
||||
new file mode 100644
|
||||
index 0000000..55e3f89
|
||||
--- /dev/null
|
||||
+++ b/tc/m_skbedit.c
|
||||
@@ -0,0 +1,192 @@
|
||||
+/*
|
||||
+ * m_skbedit.c SKB Editing module
|
||||
+ *
|
||||
+ * Copyright (c) 2008, Intel Corporation.
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify it
|
||||
+ * under the terms and conditions of the GNU General Public License,
|
||||
+ * version 2, as published by the Free Software Foundation.
|
||||
+ *
|
||||
+ * This program is distributed in the hope it will be useful, but WITHOUT
|
||||
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
+ * more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License along with
|
||||
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
|
||||
+ *
|
||||
+ * Authors: Alexander Duyck <alexander.h.duyck@intel.com>
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <unistd.h>
|
||||
+#include <string.h>
|
||||
+#include "utils.h"
|
||||
+#include "tc_util.h"
|
||||
+#include <linux/tc_act/tc_skbedit.h>
|
||||
+
|
||||
+static void
|
||||
+explain(void)
|
||||
+{
|
||||
+ fprintf(stderr, "Usage: ... skbedit "
|
||||
+ "queue_mapping QUEUE_MAPPING | priority PRIORITY \n"
|
||||
+ "QUEUE_MAPPING = device transmit queue to use\n"
|
||||
+ "PRIORITY = classID to assign to priority field\n");
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+usage(void)
|
||||
+{
|
||||
+ explain();
|
||||
+ exit(-1);
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+parse_skbedit(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
|
||||
+ struct nlmsghdr *n)
|
||||
+{
|
||||
+ struct tc_skbedit sel;
|
||||
+ int argc = *argc_p;
|
||||
+ char **argv = *argv_p;
|
||||
+ int ok = 0;
|
||||
+ struct rtattr *tail;
|
||||
+ unsigned int tmp;
|
||||
+ __u16 queue_mapping;
|
||||
+ __u32 flags = 0, priority;
|
||||
+
|
||||
+ if (matches(*argv, "skbedit") != 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ NEXT_ARG();
|
||||
+
|
||||
+ while (argc > 0) {
|
||||
+ if (matches(*argv, "queue_mapping") == 0) {
|
||||
+ flags |= SKBEDIT_F_QUEUE_MAPPING;
|
||||
+ NEXT_ARG();
|
||||
+ if (get_unsigned(&tmp, *argv, 10) || tmp > 65535) {
|
||||
+ fprintf(stderr, "Illegal queue_mapping\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ queue_mapping = tmp;
|
||||
+ ok++;
|
||||
+ } else if (matches(*argv, "priority") == 0) {
|
||||
+ flags |= SKBEDIT_F_PRIORITY;
|
||||
+ NEXT_ARG();
|
||||
+ if (get_tc_classid(&priority, *argv)) {
|
||||
+ fprintf(stderr, "Illegal priority\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ ok++;
|
||||
+ } else if (matches(*argv, "help") == 0) {
|
||||
+ usage();
|
||||
+ } else {
|
||||
+ break;
|
||||
+ }
|
||||
+ argc--;
|
||||
+ argv++;
|
||||
+ }
|
||||
+
|
||||
+ if (argc) {
|
||||
+ if (matches(*argv, "reclassify") == 0) {
|
||||
+ sel.action = TC_ACT_RECLASSIFY;
|
||||
+ NEXT_ARG();
|
||||
+ } else if (matches(*argv, "pipe") == 0) {
|
||||
+ sel.action = TC_ACT_PIPE;
|
||||
+ NEXT_ARG();
|
||||
+ } else if (matches(*argv, "drop") == 0 ||
|
||||
+ matches(*argv, "shot") == 0) {
|
||||
+ sel.action = TC_ACT_SHOT;
|
||||
+ NEXT_ARG();
|
||||
+ } else if (matches(*argv, "continue") == 0) {
|
||||
+ sel.action = TC_ACT_UNSPEC;
|
||||
+ NEXT_ARG();
|
||||
+ } else if (matches(*argv, "pass") == 0) {
|
||||
+ sel.action = TC_ACT_OK;
|
||||
+ NEXT_ARG();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (argc) {
|
||||
+ if (matches(*argv, "index") == 0) {
|
||||
+ NEXT_ARG();
|
||||
+ if (get_u32(&sel.index, *argv, 10)) {
|
||||
+ fprintf(stderr, "Pedit: Illegal \"index\"\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ argc--;
|
||||
+ argv++;
|
||||
+ ok++;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!ok) {
|
||||
+ explain();
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ tail = NLMSG_TAIL(n);
|
||||
+ addattr_l(n, MAX_MSG, tca_id, NULL, 0);
|
||||
+ addattr_l(n, MAX_MSG, TCA_SKBEDIT_PARMS, &sel, sizeof(sel));
|
||||
+ if (flags & SKBEDIT_F_QUEUE_MAPPING)
|
||||
+ addattr_l(n, MAX_MSG, TCA_SKBEDIT_QUEUE_MAPPING,
|
||||
+ &queue_mapping, sizeof(queue_mapping));
|
||||
+ if (flags & SKBEDIT_F_PRIORITY)
|
||||
+ addattr_l(n, MAX_MSG, TCA_SKBEDIT_PRIORITY,
|
||||
+ &priority, sizeof(priority));
|
||||
+ tail->rta_len = (char *)NLMSG_TAIL(n) - (char *)tail;
|
||||
+
|
||||
+ *argc_p = argc;
|
||||
+ *argv_p = argv;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int print_skbedit(struct action_util *au, FILE *f, struct rtattr *arg)
|
||||
+{
|
||||
+ struct tc_skbedit *sel;
|
||||
+ struct rtattr *tb[TCA_SKBEDIT_MAX + 1];
|
||||
+ SPRINT_BUF(b1);
|
||||
+ __u32 *priority;
|
||||
+ __u16 *queue_mapping;
|
||||
+
|
||||
+ if (arg == NULL)
|
||||
+ return -1;
|
||||
+
|
||||
+ parse_rtattr_nested(tb, TCA_SKBEDIT_MAX, arg);
|
||||
+
|
||||
+ if (tb[TCA_SKBEDIT_PARMS] == NULL) {
|
||||
+ fprintf(f, "[NULL skbedit parameters]");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ sel = RTA_DATA(tb[TCA_SKBEDIT_PARMS]);
|
||||
+
|
||||
+ fprintf(f, " skbedit");
|
||||
+
|
||||
+ if (tb[TCA_SKBEDIT_QUEUE_MAPPING] != NULL) {
|
||||
+ queue_mapping = RTA_DATA(tb[TCA_SKBEDIT_QUEUE_MAPPING]);
|
||||
+ fprintf(f, " queue_mapping %u", *queue_mapping);
|
||||
+ }
|
||||
+ if (tb[TCA_SKBEDIT_PRIORITY] != NULL) {
|
||||
+ priority = RTA_DATA(tb[TCA_SKBEDIT_PRIORITY]);
|
||||
+ fprintf(f, " priority %s", sprint_tc_classid(*priority, b1));
|
||||
+ }
|
||||
+
|
||||
+ if (show_stats) {
|
||||
+ if (tb[TCA_SKBEDIT_TM]) {
|
||||
+ struct tcf_t *tm = RTA_DATA(tb[TCA_SKBEDIT_TM]);
|
||||
+ print_tm(f, tm);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+struct action_util skbedit_action_util = {
|
||||
+ .id = "skbedit",
|
||||
+ .parse_aopt = parse_skbedit,
|
||||
+ .print_aopt = print_skbedit,
|
||||
+};
|
@ -1,142 +0,0 @@
|
||||
IPROUTE: add support for multiq qdisc
|
||||
|
||||
From: Alexander Duyck <alexander.h.duyck@intel.com>
|
||||
|
||||
Add support for multiq qdisc
|
||||
This patch adds the ability to configure the multiq qdisc. Since the qdisc does not require any input it will pull the number of bands directly from the device that it is added to the root of.
|
||||
|
||||
usage: tc qdisc add dev <DEV> root handle <HANDLE> multiq
|
||||
|
||||
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
|
||||
---
|
||||
|
||||
include/linux/pkt_sched.h | 7 ++++
|
||||
tc/Makefile | 1 +
|
||||
tc/q_multiq.c | 87 +++++++++++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 95 insertions(+), 0 deletions(-)
|
||||
create mode 100644 tc/q_multiq.c
|
||||
|
||||
|
||||
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
|
||||
index dbb7ac3..3b0e633 100644
|
||||
--- a/include/linux/pkt_sched.h
|
||||
+++ b/include/linux/pkt_sched.h
|
||||
@@ -112,6 +112,13 @@ enum
|
||||
|
||||
#define TCA_PRIO_MAX (__TCA_PRIO_MAX - 1)
|
||||
|
||||
+/* MULTIQ section */
|
||||
+
|
||||
+struct tc_multiq_qopt {
|
||||
+ __u16 bands; /* Number of bands */
|
||||
+ __u16 max_bands; /* Maximum number of queues */
|
||||
+};
|
||||
+
|
||||
/* TBF section */
|
||||
|
||||
struct tc_tbf_qopt
|
||||
diff --git a/tc/Makefile b/tc/Makefile
|
||||
index 1b4169d..743a946 100644
|
||||
--- a/tc/Makefile
|
||||
+++ b/tc/Makefile
|
||||
@@ -12,6 +12,7 @@ TCMODULES += q_prio.o
|
||||
TCMODULES += q_tbf.o
|
||||
TCMODULES += q_cbq.o
|
||||
TCMODULES += q_rr.o
|
||||
+TCMODULES += q_multiq.o
|
||||
TCMODULES += q_netem.o
|
||||
TCMODULES += f_rsvp.o
|
||||
TCMODULES += f_u32.o
|
||||
diff --git a/tc/q_multiq.c b/tc/q_multiq.c
|
||||
new file mode 100644
|
||||
index 0000000..d3f6188
|
||||
--- /dev/null
|
||||
+++ b/tc/q_multiq.c
|
||||
@@ -0,0 +1,87 @@
|
||||
+/*
|
||||
+ * q_multiq.c Multiqueue aware qdisc
|
||||
+ *
|
||||
+ * Copyright (c) 2008, Intel Corporation.
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify it
|
||||
+ * under the terms and conditions of the GNU General Public License,
|
||||
+ * version 2, as published by the Free Software Foundation.
|
||||
+ *
|
||||
+ * This program is distributed in the hope it will be useful, but WITHOUT
|
||||
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
+ * more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License along with
|
||||
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
|
||||
+ *
|
||||
+ * Author: Alexander Duyck <alexander.h.duyck@intel.com>
|
||||
+ *
|
||||
+ * Original Authors: PJ Waskiewicz, <peter.p.waskiewicz.jr@intel.com> (RR)
|
||||
+ * Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> (from PRIO)
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <unistd.h>
|
||||
+#include <syslog.h>
|
||||
+#include <fcntl.h>
|
||||
+#include <sys/socket.h>
|
||||
+#include <netinet/in.h>
|
||||
+#include <arpa/inet.h>
|
||||
+#include <string.h>
|
||||
+
|
||||
+#include "utils.h"
|
||||
+#include "tc_util.h"
|
||||
+
|
||||
+static void explain(void)
|
||||
+{
|
||||
+ fprintf(stderr, "Usage: ... multiq [help]\n");
|
||||
+}
|
||||
+
|
||||
+#define usage() return(-1)
|
||||
+
|
||||
+static int multiq_parse_opt(struct qdisc_util *qu, int argc, char **argv,
|
||||
+ struct nlmsghdr *n)
|
||||
+{
|
||||
+ struct tc_multiq_qopt opt;
|
||||
+
|
||||
+ if (argc > 0) {
|
||||
+ if (strcmp(*argv, "help") == 0) {
|
||||
+ explain();
|
||||
+ return -1;
|
||||
+ } else {
|
||||
+ fprintf(stderr, "What is \"%s\"?\n", *argv);
|
||||
+ explain();
|
||||
+ return -1;
|
||||
+ }
|
||||
+ argc--; argv++;
|
||||
+ }
|
||||
+
|
||||
+ addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt));
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int multiq_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
|
||||
+{
|
||||
+ struct tc_multiq_qopt *qopt;
|
||||
+
|
||||
+ if (opt == NULL)
|
||||
+ return 0;
|
||||
+ if (RTA_PAYLOAD(opt) < sizeof(*qopt))
|
||||
+ return 0;
|
||||
+
|
||||
+ qopt = RTA_DATA(opt);
|
||||
+
|
||||
+ fprintf(f, "bands %u/%u ", qopt->bands, qopt->max_bands);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+struct qdisc_util multiq_qdisc_util = {
|
||||
+ .id = "multiq",
|
||||
+ .parse_qopt = multiq_parse_opt,
|
||||
+ .print_qopt = multiq_print_opt,
|
||||
+};
|
@ -1,11 +0,0 @@
|
||||
--- lib/utils.c
|
||||
+++ lib/utils.c
|
||||
@@ -439,7 +439,7 @@
|
||||
len = 4;
|
||||
}
|
||||
|
||||
- hash = addr[len-1] ^ addr[len-2] ^ addr[len-3] ^ addr[len-4];
|
||||
+ hash = (addr[len-1] ^ addr[len-2] ^ addr[len-3] ^ addr[len-4]) & 0xff;
|
||||
|
||||
for (n = nht[hash]; n; n = n->next) {
|
||||
if (n->addr.family == af &&
|
@ -1,32 +0,0 @@
|
||||
--- misc/ss.c 2009-02-19 13:55:43.000000000 +0100
|
||||
+++ misc/ss.c 2009-02-19 13:58:07.000000000 +0100
|
||||
@@ -1509,6 +1509,7 @@
|
||||
h = (struct nlmsghdr*)buf;
|
||||
while (NLMSG_OK(h, status)) {
|
||||
int err;
|
||||
+ struct inet_diag_msg *r = NLMSG_DATA(h);
|
||||
|
||||
if (/*h->nlmsg_pid != rth->local.nl_pid ||*/
|
||||
h->nlmsg_seq != 123456)
|
||||
@@ -1527,6 +1528,10 @@
|
||||
return 0;
|
||||
}
|
||||
if (!dump_fp) {
|
||||
+ if (!(f->families & (1<<r->idiag_family))) {
|
||||
+ h = NLMSG_NEXT(h, status);
|
||||
+ continue;
|
||||
+ }
|
||||
err = tcp_show_sock(h, NULL);
|
||||
if (err < 0)
|
||||
return err;
|
||||
@@ -2634,9 +2639,7 @@
|
||||
int mask2;
|
||||
if (preferred_family == AF_INET ||
|
||||
preferred_family == AF_INET6) {
|
||||
- mask2= (1<<TCP_DB);
|
||||
- if (!do_default)
|
||||
- mask2 = (1<<UDP_DB)|(1<<RAW_DB);
|
||||
+ mask2= current_filter.dbs;
|
||||
} else if (preferred_family == AF_PACKET) {
|
||||
mask2 = PACKET_DBM;
|
||||
} else if (preferred_family == AF_UNIX) {
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:dc0e0f66c0928b5b4d4ae6bc833f3b21d0d4f5dbdaaf0711e42497bf50294512
|
||||
size 359144
|
@ -1,7 +1,7 @@
|
||||
Index: iproute2-2.6.25/ip/xfrm.h
|
||||
===================================================================
|
||||
--- iproute2-2.6.25.orig/ip/xfrm.h
|
||||
+++ iproute2-2.6.25/ip/xfrm.h
|
||||
--- ip/xfrm.h
|
||||
+++ ip/xfrm.h
|
||||
@@ -32,9 +32,6 @@
|
||||
#ifndef IPPROTO_SCTP
|
||||
# define IPPROTO_SCTP 132
|
71
iproute2-2.6.29-1-libdir-1.diff
Normal file
71
iproute2-2.6.29-1-libdir-1.diff
Normal file
@ -0,0 +1,71 @@
|
||||
diff -ur iproute2-2.6.29-1.orig/include/iptables.h iproute2-2.6.29-1/include/iptables.h
|
||||
--- include/iptables.h 2009-03-24 23:40:54.000000000 +0100
|
||||
+++ include/iptables.h 2009-08-12 14:07:27.568892610 +0200
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "libiptc/libiptc.h"
|
||||
|
||||
#ifndef IPT_LIB_DIR
|
||||
-#define IPT_LIB_DIR "/usr/local/lib/iptables"
|
||||
+#define IPT_LIB_DIR LIBDIR
|
||||
#endif
|
||||
|
||||
#ifndef IPPROTO_SCTP
|
||||
diff -ur iproute2-2.6.29-1.orig/Makefile iproute2-2.6.29-1/Makefile
|
||||
--- Makefile 2009-03-24 23:40:54.000000000 +0100
|
||||
+++ Makefile 2009-08-12 14:07:27.568892610 +0200
|
||||
@@ -23,7 +23,7 @@
|
||||
CC = gcc
|
||||
HOSTCC = gcc
|
||||
CCOPTS = -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall
|
||||
-CFLAGS = $(CCOPTS) -I../include $(DEFINES)
|
||||
+CFLAGS = -DLIBDIR=\"$(LIBDIR)\" $(CCOPTS) -I../include $(DEFINES)
|
||||
YACCFLAGS = -d -t -v
|
||||
|
||||
LDLIBS += -L../lib -lnetlink -lutil
|
||||
diff -ur iproute2-2.6.29-1.orig/netem/Makefile iproute2-2.6.29-1/netem/Makefile
|
||||
--- netem/Makefile 2009-03-24 23:40:54.000000000 +0100
|
||||
+++ netem/Makefile 2009-08-12 14:07:27.570892934 +0200
|
||||
@@ -5,6 +5,8 @@
|
||||
CCOPTS = $(CBUILD_CFLAGS)
|
||||
LDLIBS += -lm
|
||||
|
||||
+LIBDIR = /usr/lib
|
||||
+
|
||||
all: $(DISTGEN) $(DISTDATA)
|
||||
|
||||
$(DISTGEN):
|
||||
Nur in iproute2-2.6.29-1/netem: Makefile.orig.
|
||||
Nur in iproute2-2.6.29-1/netem: Makefile.rej.
|
||||
Nur in iproute2-2.6.29-1/tc: Makefile.orig.
|
||||
Nur in iproute2-2.6.29-1/tc: Makefile.rej.
|
||||
Nur in iproute2-2.6.29-1/tc: tc_util.c.orig.
|
||||
Nur in iproute2-2.6.29-1/tc: tc_util.c.rej.
|
||||
--- Makefile 2009-03-24 23:40:54.000000000 +0100
|
||||
+++ Makefile 2009-08-12 14:22:45.785935139 +0200
|
||||
@@ -1,9 +1,9 @@
|
||||
DESTDIR=/usr/
|
||||
LIBDIR=/usr/lib/
|
||||
-SBINDIR=/sbin
|
||||
+SBINDIR=/usr/sbin
|
||||
CONFDIR=/etc/iproute2
|
||||
-DOCDIR=/share/doc/iproute2
|
||||
-MANDIR=/share/man
|
||||
+DOCDIR=/usr/share/doc/packages/iproute2
|
||||
+MANDIR=/usr/share/man
|
||||
|
||||
# Path to db_185.h include
|
||||
DBM_INCLUDE:=/usr/include
|
||||
--- netem/Makefile 2009-03-24 23:40:54.000000000 +0100
|
||||
+++ netem/Makefile 2009-08-12 14:24:57.748903617 +0200
|
||||
@@ -20,9 +20,9 @@
|
||||
$(HOSTCC) $(CCOPTS) -I../include -o $@ $@.c -lm
|
||||
|
||||
install: all
|
||||
- mkdir -p $(DESTDIR)/lib/tc
|
||||
+ mkdir -p $(DESTDIR)/usr/share/tc
|
||||
for i in $(DISTDATA); \
|
||||
- do install -m 755 $$i $(DESTDIR)/lib/tc; \
|
||||
+ do install -m 755 $$i $(DESTDIR)/usr/share/tc; \
|
||||
done
|
||||
|
||||
clean:
|
3
iproute2-2.6.29-1.tar.bz2
Normal file
3
iproute2-2.6.29-1.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:13ffb0ffe5404c9dcc8bed8c692f07d934aa3fd44661df79dd1efbb37f83fb9b
|
||||
size 367905
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Aug 12 12:45:56 UTC 2009 - adrian@suse.de
|
||||
|
||||
- update to version 2.6.29-1
|
||||
* Support for lxc
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 28 13:31:54 CEST 2009 - ms@suse.de
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# spec file for package iproute2 (Version 2.6.25)
|
||||
# spec file for package iproute2 (Version 2.6.29.1)
|
||||
#
|
||||
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
@ -24,26 +24,22 @@ License: GPL v2 or later
|
||||
Group: Productivity/Networking/Routing
|
||||
Provides: iproute
|
||||
AutoReqProv: on
|
||||
Version: 2.6.25
|
||||
Release: 46
|
||||
Version: 2.6.29.1
|
||||
Release: 1
|
||||
%define rversion 2.6.29-1
|
||||
Summary: Advanced Routing
|
||||
Url: http://developer.osdl.org/dev/iproute2/
|
||||
Source0: %name-%version.tar.bz2
|
||||
Patch0: %name-2.6.25-libdir-1.diff
|
||||
Patch1: %name-2.6.25-HZ.diff
|
||||
Patch2: %name-2.6.25-pdfdoc.diff
|
||||
Patch3: %name-2.6.25-tc-flex-fixes.diff
|
||||
Patch4: %name-2.6.25-resolve-address.diff
|
||||
Patch5: %name-2.6.25-fragtimeout.diff
|
||||
Patch6: %name-2.6.25-flushcheckuid.diff
|
||||
Patch7: %name-2.6.25-m_skbedit.patch
|
||||
Patch8: %name-2.6.25-q_multiq.patch
|
||||
Patch9: %name-2.6.25-DCCP-redefine
|
||||
Patch10: %name-2.6.25-warnings.diff
|
||||
Patch11: %name-2.6.25-hw-address-size.diff
|
||||
Patch12: %name-2.6.25-skbedit-memset.diff
|
||||
Patch13: %name-2.6.25-ss-inet6.diff
|
||||
Patch14: %name-2.6.25-iptunnel-fclose.diff
|
||||
Source0: %name-%rversion.tar.bz2
|
||||
Patch0: %name-2.6.29-1-libdir-1.diff
|
||||
Patch1: %name-2.6.29-1-HZ.diff
|
||||
Patch2: %name-2.6.29-1-pdfdoc.diff
|
||||
Patch3: %name-2.6.29-1-tc-flex-fixes.diff
|
||||
Patch4: %name-2.6.29-1-fragtimeout.diff
|
||||
Patch5: %name-2.6.29-1-flushcheckuid.diff
|
||||
Patch6: %name-2.6.29-1-DCCP-redefine
|
||||
Patch7: %name-2.6.29-1-warnings.diff
|
||||
Patch8: %name-2.6.29-1-skbedit-memset.diff
|
||||
Patch9: %name-2.6.29-1-iptunnel-fclose.diff
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%package -n libnetlink-devel
|
||||
@ -71,7 +67,7 @@ Authors:
|
||||
Stephem Hemminger <shemminger at osdl dot org>
|
||||
|
||||
%prep
|
||||
%setup -q -n %name-%version
|
||||
%setup -q -n %name-%rversion
|
||||
%patch
|
||||
%patch1
|
||||
%patch2
|
||||
@ -79,14 +75,9 @@ Authors:
|
||||
%patch4
|
||||
%patch5
|
||||
%patch6
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10
|
||||
%patch11 -p1
|
||||
%patch12
|
||||
%patch13
|
||||
%patch14
|
||||
%patch7
|
||||
%patch8
|
||||
%patch9
|
||||
find . -name *.orig -print0 | xargs -r0 rm -v
|
||||
|
||||
%build
|
||||
@ -106,7 +97,6 @@ mv $RPM_BUILD_ROOT/usr/sbin/ip $RPM_BUILD_ROOT/sbin
|
||||
mkdir -p $RPM_BUILD_ROOT/bin
|
||||
ln -sf /sbin/ip $RPM_BUILD_ROOT/bin/ip
|
||||
rm $RPM_BUILD_ROOT/usr/sbin/ifcfg
|
||||
rm -rf $RPM_BUILD_ROOT/usr/share/doc/iproute2
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
Loading…
Reference in New Issue
Block a user