AA: iproute2: Backport r36910
[openwrt/svn-archive/archive.git] / package / iproute2 / patches / 900-drop_FAILED_POLICY.patch
1 From 4e7dbf76227e8c7be7897dc81def3011f637864d Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Thu, 30 May 2013 11:54:04 +0200
4 Subject: [PATCH] add support for dropping with FAILED_POLICY
5
6 ---
7 include/linux/fib_rules.h | 4 ++++
8 include/linux/rtnetlink.h | 1 +
9 ip/rtm_map.c | 4 ++++
10 3 files changed, 9 insertions(+)
11
12 Index: iproute2-3.3.0/include/linux/fib_rules.h
13 ===================================================================
14 --- iproute2-3.3.0.orig/include/linux/fib_rules.h 2013-06-10 15:48:46.771045967 +0200
15 +++ iproute2-3.3.0/include/linux/fib_rules.h 2013-06-10 15:48:46.763045967 +0200
16 @@ -64,6 +64,10 @@
17 FR_ACT_BLACKHOLE, /* Drop without notification */
18 FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */
19 FR_ACT_PROHIBIT, /* Drop with EACCES */
20 + FR_ACT_RES8,
21 + FR_ACT_RES9,
22 + FR_ACT_RES10,
23 + FR_ACT_FAILED_POLICY, /* Drop with EPERM */
24 __FR_ACT_MAX,
25 };
26
27 Index: iproute2-3.3.0/include/linux/rtnetlink.h
28 ===================================================================
29 --- iproute2-3.3.0.orig/include/linux/rtnetlink.h 2013-06-10 15:48:46.771045967 +0200
30 +++ iproute2-3.3.0/include/linux/rtnetlink.h 2013-06-10 15:48:46.763045967 +0200
31 @@ -191,6 +191,7 @@
32 RTN_THROW, /* Not in this table */
33 RTN_NAT, /* Translate this address */
34 RTN_XRESOLVE, /* Use external resolver */
35 + RTN_FAILED_POLICY, /* Source address failed policy */
36 __RTN_MAX
37 };
38
39 Index: iproute2-3.3.0/ip/rtm_map.c
40 ===================================================================
41 --- iproute2-3.3.0.orig/ip/rtm_map.c 2013-06-10 15:48:46.771045967 +0200
42 +++ iproute2-3.3.0/ip/rtm_map.c 2013-06-10 15:48:46.763045967 +0200
43 @@ -49,6 +49,8 @@
44 return "nat";
45 case RTN_XRESOLVE:
46 return "xresolve";
47 + case RTN_FAILED_POLICY:
48 + return "failed_policy";
49 default:
50 snprintf(buf, len, "%d", id);
51 return buf;
52 @@ -84,6 +86,8 @@
53 res = RTN_UNICAST;
54 else if (strcmp(arg, "throw") == 0)
55 res = RTN_THROW;
56 + else if (strcmp(arg, "failed_policy") == 0)
57 + res = RTN_FAILED_POLICY;
58 else {
59 res = strtoul(arg, &end, 0);
60 if (!end || end == arg || *end || res > 255)