Show
Ignore:
Timestamp:
05/08/06 09:15:35 (7 years ago)
Author:
ahu
Message:

implement 'back mapping' for IPv4 addresses mapped to IPv6, so things 'just work' and there is no need to manually map
IPv4 addresses to IPv6 for allow-from. Noted by Marcus Rueckert.
Added ::1/128 to default allow-from, as well as fe80::/16.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/pdns_recursor.cc

    r825 r826  
    684684    g_stats.addRemote(addr); 
    685685    if(g_allowFrom && !g_allowFrom->match(&addr)) { 
     686      if(!g_quiet)  
     687        L<<Logger::Error<<"["<<MT->getTid()<<"] dropping TCP query from "<<addr.toString()<<", address not matched by allow-from"<<endl; 
     688 
    686689      g_stats.unauthorizedTCP++; 
    687690      Utility::closesocket(newsock); 
     
    709712  } 
    710713} 
    711  
     714  
    712715void handleNewUDPQuestion(int fd, boost::any& var) 
    713716{ 
     
    720723    g_stats.addRemote(fromaddr); 
    721724    if(g_allowFrom && !g_allowFrom->match(&fromaddr)) { 
     725      cout<<"mapped: "<<fromaddr.isMappedIPv4()<<endl; 
     726      if(!g_quiet)  
     727        L<<Logger::Error<<"["<<MT->getTid()<<"] dropping UDP query from "<<fromaddr.toString()<<", address not matched by allow-from"<<endl; 
     728 
    722729      g_stats.unauthorizedUDP++; 
    723730      return; 
     
    15871594    ::arg().set("remotes-ringbuffer-entries", "maximum number of packets to store statistics for")="0"; 
    15881595    ::arg().set("version-string", "string reported on version.pdns or version.bind")="PowerDNS Recursor "VERSION" $Id$"; 
    1589     ::arg().set("allow-from", "If set, only allow these comma separated netmasks to recurse")="127.0.0.0/8, 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12"; 
     1596    ::arg().set("allow-from", "If set, only allow these comma separated netmasks to recurse")="127.0.0.0/8, 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, ::1/128, fe80::/16"; 
    15901597    ::arg().set("max-tcp-per-client", "If set, maximum number of TCP sessions per client (IP address)")="0"; 
    15911598    ::arg().set("fork", "If set, fork the daemon for possible double performance")="no";