diff options
author | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2011-02-21 00:03:20 +0000 |
---|---|---|
committer | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2011-02-21 00:03:20 +0000 |
commit | 5b934a6fcf88c52d872dbd7ecb9a0be4aeced5b6 (patch) | |
tree | 60d2028d39849ec2dbc5fe540addd1ef7b576204 /package | |
parent | 69f9eb90f800c74319aea3aaaadd205fbc9a7bd6 (diff) |
kernel: add a new scheduler action for restoring the connection tracking mark - useful for ingress shaping, will be used for replacing IMQ later
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25639 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r-- | package/iproute2/patches/200-act_connmark.patch | 84 | ||||
-rw-r--r-- | package/kernel/modules/netsupport.mk | 1 |
2 files changed, 85 insertions, 0 deletions
diff --git a/package/iproute2/patches/200-act_connmark.patch b/package/iproute2/patches/200-act_connmark.patch new file mode 100644 index 0000000000..561041f0af --- /dev/null +++ b/package/iproute2/patches/200-act_connmark.patch @@ -0,0 +1,84 @@ +--- a/tc/Makefile ++++ b/tc/Makefile +@@ -36,6 +36,7 @@ TCMODULES += m_mirred.o + TCMODULES += m_nat.o + TCMODULES += m_pedit.o + TCMODULES += m_skbedit.o ++TCMODULES += m_connmark.o + TCMODULES += p_ip.o + TCMODULES += p_icmp.o + TCMODULES += p_tcp.o +--- /dev/null ++++ b/tc/m_connmark.c +@@ -0,0 +1,71 @@ ++/* ++ * m_connmark.c Connection tracking marking import ++ * ++ * Copyright (c) 2011 Felix Fietkau <nbd@openwrt.org> ++ * ++ * 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. ++ */ ++ ++#include <stdio.h> ++#include <stdlib.h> ++#include <unistd.h> ++#include <string.h> ++#include "utils.h" ++#include "tc_util.h" ++ ++static void ++explain(void) ++{ ++ fprintf(stderr, "Usage: ... connmark\n"); ++} ++ ++static void ++usage(void) ++{ ++ explain(); ++ exit(-1); ++} ++ ++static int ++parse_connmark(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, ++ struct nlmsghdr *n) ++{ ++ int argc = *argc_p; ++ char **argv = *argv_p; ++ ++ if (matches(*argv, "connmark") != 0) ++ return -1; ++ ++ NEXT_ARG(); ++ ++ *argc_p = argc; ++ *argv_p = argv; ++ return 0; ++} ++ ++static int print_connmark(struct action_util *au, FILE *f, struct rtattr *arg) ++{ ++ if (arg == NULL) ++ return -1; ++ ++ fprintf(f, " connmark"); ++ ++ return 0; ++} ++ ++struct action_util connmark_action_util = { ++ .id = "connmark", ++ .parse_aopt = parse_connmark, ++ .print_aopt = print_connmark, ++}; diff --git a/package/kernel/modules/netsupport.mk b/package/kernel/modules/netsupport.mk index e0e423893f..c86003417d 100644 --- a/package/kernel/modules/netsupport.mk +++ b/package/kernel/modules/netsupport.mk @@ -551,6 +551,7 @@ define KernelPackage/sched CONFIG_NET_ACT_MIRRED \ CONFIG_NET_ACT_IPT \ CONFIG_NET_ACT_POLICE \ + CONFIG_NET_ACT_CONNMARK \ CONFIG_NET_EMATCH=y \ CONFIG_NET_EMATCH_CMP \ CONFIG_NET_EMATCH_NBYTE \ |