hdais

limit reply size < 512bytes (Unbound-1.4.19 patch)

Jan 12th, 2013
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.32 KB | None | 0 0
  1. diff -ur unbound-1.4.19/daemon/acl_list.c unbound-1.4.19-allowminimal/daemon/acl_list.c
  2. --- unbound-1.4.19/daemon/acl_list.c    2010-07-07 22:13:36.000000000 +0900
  3. +++ unbound-1.4.19-allowminimal/daemon/acl_list.c       2013-01-09 03:16:53.000000000 +0900
  4. @@ -105,6 +105,8 @@
  5.                 control = acl_refuse;
  6.         else if(strcmp(s2, "allow_snoop") == 0)
  7.                 control = acl_allow_snoop;
  8. +       else if(strcmp(s2, "allow_minimal") == 0)
  9. +               control = acl_allow_minimal;
  10.         else {
  11.                 log_err("access control type %s unknown", str);
  12.                 return 0;
  13. diff -ur unbound-1.4.19/daemon/acl_list.h unbound-1.4.19-allowminimal/daemon/acl_list.h
  14. --- unbound-1.4.19/daemon/acl_list.h    2010-07-07 22:13:36.000000000 +0900
  15. +++ unbound-1.4.19-allowminimal/daemon/acl_list.h       2013-01-09 03:15:11.000000000 +0900
  16. @@ -58,7 +58,9 @@
  17.         /** allow full access for recursion (+RD) queries */
  18.         acl_allow,
  19.         /** allow full access for all queries, recursion and cache snooping */
  20. -       acl_allow_snoop
  21. +       acl_allow_snoop,
  22. +       /** allow minimal access for recursion queries */
  23. +       acl_allow_minimal
  24.  };
  25.  
  26.  /**
  27. diff -ur unbound-1.4.19/daemon/worker.c unbound-1.4.19-allowminimal/daemon/worker.c
  28. --- unbound-1.4.19/daemon/worker.c      2012-07-31 20:33:06.000000000 +0900
  29. +++ unbound-1.4.19-allowminimal/daemon/worker.c 2013-01-12 15:18:29.000000000 +0900
  30. @@ -831,6 +831,13 @@
  31.                 log_addr(VERB_CLIENT,"from",&repinfo->addr, repinfo->addrlen);
  32.                 edns.udp_size = NORMAL_UDP_SIZE;
  33.         }
  34. +       if(edns.edns_present && acl == acl_allow_minimal &&
  35. +               edns.udp_size > NORMAL_UDP_SIZE && c->type == comm_udp) {
  36. +               verbose(VERB_QUERY, "worker request: UDP EDNS0 query matching "
  37. +                       "ACL allow_minimal, EDNS bufsize ignored");
  38. +               log_addr(VERB_CLIENT,"from",&repinfo->addr, repinfo->addrlen);
  39. +               edns.udp_size = NORMAL_UDP_SIZE;
  40. +       }
  41.         if(edns.edns_present && edns.udp_size < LDNS_HEADER_SIZE) {
  42.                 verbose(VERB_ALGO, "worker request: edns is too small.");
  43.                 log_addr(VERB_CLIENT, "from", &repinfo->addr, repinfo->addrlen);
  44. diff -ur unbound-1.4.19/util/configparser.y unbound-1.4.19-allowminimal/util/configparser.y
  45.  
  46. --- unbound-1.4.19/util/configparser.y  2012-04-10 18:16:39.000000000 +0900
  47. +++ unbound-1.4.19-allowminimal/util/configparser.y     2013-01-09 23:28:30.000000000 +0900
  48. @@ -865,9 +865,10 @@
  49.                 OUTYY(("P(server_access_control:%s %s)\n", $2, $3));
  50.                 if(strcmp($3, "deny")!=0 && strcmp($3, "refuse")!=0 &&
  51.                         strcmp($3, "allow")!=0 &&
  52. -                       strcmp($3, "allow_snoop")!=0) {
  53. -                       yyerror("expected deny, refuse, allow or allow_snoop "
  54. -                               "in access control action");
  55. +                       strcmp($3, "allow_snoop")!=0 &&
  56. +                       strcmp($3, "allow_minimal")!=0 ) {
  57. +                       yyerror("expected deny, refuse, allow, allow_snoop or "
  58. +                               "allow_minimal in access control action");
  59.                 } else {
  60.                         if(!cfg_str2list_insert(&cfg_parser->cfg->acls, $2, $3))
  61.                                 fatal_exit("out of memory adding acl");
Advertisement
Add Comment
Please, Sign In to add comment