d6c5ccd7b24bc669bedf8e7d8456b6b4a923297f
[openwrt.git] / package / network / utils / 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 diff --git a/include/linux/fib_rules.h b/include/linux/fib_rules.h
13 index 51da65b..3420838 100644
14 --- a/include/linux/fib_rules.h
15 +++ b/include/linux/fib_rules.h
16 @@ -64,6 +64,10 @@ enum {
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 diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
28 index 93370bd..cfec9ff 100644
29 --- a/include/linux/rtnetlink.h
30 +++ b/include/linux/rtnetlink.h
31 @@ -203,6 +203,7 @@ enum {
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 diff --git a/ip/rtm_map.c b/ip/rtm_map.c
40 index 21e818b..8ad2d07 100644
41 --- a/ip/rtm_map.c
42 +++ b/ip/rtm_map.c
43 @@ -49,6 +49,8 @@ char *rtnl_rtntype_n2a(int id, char *buf, int len)
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 @@ int rtnl_rtntype_a2n(int *id, char *arg)
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)
61 -- 
62 1.7.10.4
63