180-drop_FAILED_POLICY.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. include/linux/fib_rules.h | 4 ++++
  7. include/linux/rtnetlink.h | 1 +
  8. ip/rtm_map.c | 4 ++++
  9. 3 files changed, 9 insertions(+)
  10. --- a/ip/rtm_map.c
  11. +++ b/ip/rtm_map.c
  12. @@ -48,6 +48,8 @@ char *rtnl_rtntype_n2a(int id, char *buf
  13. return "nat";
  14. case RTN_XRESOLVE:
  15. return "xresolve";
  16. + case RTN_FAILED_POLICY:
  17. + return "failed_policy";
  18. default:
  19. snprintf(buf, len, "%d", id);
  20. return buf;
  21. @@ -83,6 +85,8 @@ int rtnl_rtntype_a2n(int *id, char *arg)
  22. res = RTN_UNICAST;
  23. else if (strcmp(arg, "throw") == 0)
  24. res = RTN_THROW;
  25. + else if (strcmp(arg, "failed_policy") == 0)
  26. + res = RTN_FAILED_POLICY;
  27. else {
  28. res = strtoul(arg, &end, 0);
  29. if (!end || end == arg || *end || res > 255)
  30. --- a/include/uapi/linux/rtnetlink.h
  31. +++ b/include/uapi/linux/rtnetlink.h
  32. @@ -228,6 +228,7 @@ enum {
  33. RTN_THROW, /* Not in this table */
  34. RTN_NAT, /* Translate this address */
  35. RTN_XRESOLVE, /* Use external resolver */
  36. + RTN_FAILED_POLICY, /* Source address failed policy */
  37. __RTN_MAX
  38. };