From ba58ef8bf8d35190e48e2f61e0351325a54ed3e8 Mon Sep 17 00:00:00 2001 From: Shibby Date: Sun, 31 Jul 2016 10:33:16 +0200 Subject: [PATCH] dnsmasq: stay close as possible to master branch to 2.75 we used a fork of dnsmasq by "guns" https://github.com/guns/dnsmasq.git now we switch to master branch http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=shortlog;h=refs/heads/master this commit remove a differences between those 2 branches. We only leave Tomato specific code. --- release/src-rt-6.x.4708/router/dnsmasq/.gitignore | 14 --- release/src-rt-6.x.4708/router/dnsmasq/PKGBUILD | 36 ------- .../src-rt-6.x.4708/router/dnsmasq/README.markdown | 13 --- .../router/dnsmasq/contrib/guns/cache/Rakefile | 116 --------------------- .../router/dnsmasq/contrib/guns/conf/dnsmasq.conf | 54 ---------- .../router/dnsmasq/contrib/guns/conf/resolv.conf | 12 --- .../router/dnsmasq/contrib/guns/dnsmasq.rc | 36 ------- .../router/dnsmasq/contrib/guns/dnsmasq.service | 13 --- .../src-rt-6.x.4708/router/dnsmasq/dnsmasq.install | 9 -- release/src-rt-6.x.4708/router/dnsmasq/doc.html | 1 - .../src-rt-6.x.4708/router/dnsmasq/src/blockdata.c | 8 +- release/src-rt-6.x.4708/router/dnsmasq/src/cache.c | 27 +---- .../src-rt-6.x.4708/router/dnsmasq/src/dnsmasq.h | 2 - release/src-rt-6.x.4708/router/dnsmasq/src/lease.c | 4 +- .../src-rt-6.x.4708/router/dnsmasq/src/network.c | 6 +- .../src-rt-6.x.4708/router/dnsmasq/src/option.c | 26 ++--- release/src-rt-6.x.4708/router/dnsmasq/src/radv.c | 6 +- .../src-rt-6.x.4708/router/dnsmasq/src/rfc2131.c | 1 - release/src-rt-6.x.4708/router/dnsmasq/src/util.c | 6 +- 19 files changed, 28 insertions(+), 362 deletions(-) delete mode 100644 release/src-rt-6.x.4708/router/dnsmasq/.gitignore delete mode 100644 release/src-rt-6.x.4708/router/dnsmasq/PKGBUILD delete mode 100644 release/src-rt-6.x.4708/router/dnsmasq/README.markdown delete mode 100644 release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/cache/Rakefile delete mode 100644 release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/conf/dnsmasq.conf delete mode 100644 release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/conf/resolv.conf delete mode 100644 release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/dnsmasq.rc delete mode 100644 release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/dnsmasq.service delete mode 100644 release/src-rt-6.x.4708/router/dnsmasq/dnsmasq.install diff --git a/release/src-rt-6.x.4708/router/dnsmasq/.gitignore b/release/src-rt-6.x.4708/router/dnsmasq/.gitignore deleted file mode 100644 index 23f11488ab..0000000000 --- a/release/src-rt-6.x.4708/router/dnsmasq/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -src/*.o -src/*.mo -src/dnsmasq.pot -src/dnsmasq -src/dnsmasq_baseline -src/.copts_* -contrib/wrt/dhcp_lease_time -contrib/wrt/dhcp_release -debian/base/ -debian/daemon/ -debian/files -debian/substvars -debian/utils-substvars -debian/utils/ diff --git a/release/src-rt-6.x.4708/router/dnsmasq/PKGBUILD b/release/src-rt-6.x.4708/router/dnsmasq/PKGBUILD deleted file mode 100644 index 6b5ec5eff1..0000000000 --- a/release/src-rt-6.x.4708/router/dnsmasq/PKGBUILD +++ /dev/null @@ -1,36 +0,0 @@ -# Maintainer: Sung Pae -pkgname=dnsmasq-nerv -pkgver= -pkgrel=1 -pkgdesc="Custom dnsmasq build" -arch=('x86_64') -url="https://github.com/guns/dnsmasq" -license=('GPL') -groups=('nerv') -backup=('etc/dnsmasq/dnsmasq.conf' - 'etc/dnsmasq/resolv.conf') -depends=('glibc' 'libidn') -install=dnsmasq.install -makedepends=('git') -provides=('dnsmasq') -conflicts=('dnsmasq') -replaces=('dnsmasq-guns') - -envmake() { - DESTDIR="$pkgdir/" PREFIX=/usr BINDIR=/usr/bin RCDIR= \ - make -e -j $(grep -c ^processor /proc/cpuinfo) "$@" -} - -pkgver() { - printf %s "$(git describe --long | tr - .)" -} - -build() { - cd "$startdir" - envmake all-i18n -} - -package() { - cd "$startdir" - envmake install -} diff --git a/release/src-rt-6.x.4708/router/dnsmasq/README.markdown b/release/src-rt-6.x.4708/router/dnsmasq/README.markdown deleted file mode 100644 index 0529e6fa8c..0000000000 --- a/release/src-rt-6.x.4708/router/dnsmasq/README.markdown +++ /dev/null @@ -1,13 +0,0 @@ -This is a __personal fork__ of dnsmasq, and is updated by hand. Simon Kelley's -official homepage for dnsmasq is located at: - -http://www.thekelleys.org.uk/dnsmasq/doc.html - -and the official repository may be cloned with - -``` -git clone git://thekelleys.org.uk/dnsmasq.git -``` - -Please do not clone or use this repository if you are not interested in my -personal alterations. You will be better served by tracking the URL above. diff --git a/release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/cache/Rakefile b/release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/cache/Rakefile deleted file mode 100644 index 63cd183f9d..0000000000 --- a/release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/cache/Rakefile +++ /dev/null @@ -1,116 +0,0 @@ -# -*- encoding: utf-8 -*- - -task :default => :dump - -desc 'Dump and merge dnsmasq host cache' -task :dump do - require 'set' - require 'etc' - require 'fileutils' - - pid = %x(ps axo pid,ucomm).lines.find { |l| l.strip =~ /\bdnsmasq\z/ }.to_i - return if pid.zero? - - # Create a table of hostnames to addresses, eliding any aliases of localhost - parse_hosts = lambda do |buf| - hosts, locals = {}, Set.new(%w[127.0.0.1 ::1 0.0.0.0 ::]) - buf.lines.each do |l| - addr, host = l.chomp.split "\t" - next if locals.include? addr - hosts[host] ||= Set.new - hosts[host] << addr - end - hosts - end - - # Record current cache - cache = File.expand_path 'hosts.cache' - hosts = File.exists?(cache) ? parse_hosts.call(File.read cache) : {} - - # Send USR1 and wait for dnsmasq to close the cache file - user = Etc.getpwnam 'dnsmasq' - FileUtils.touch cache - File.chown user.uid, user.gid, cache - Process.kill 'SIGUSR1', pid - sleep 0.1 until %x(lsof -p #{pid} 2>/dev/null).lines.grep(Regexp.new cache).empty? - - # Merge old cache records with new ones so we don't lose any records - hosts.merge! parse_hosts.call(File.read cache) - File.open cache, 'w' do |f| - f.puts hosts.sort.reduce('') { |buf, (host, addrs)| - buf << addrs.sort.map { |a| "#{a}\t#{host}\n" }.join - } - end -end - -def blacklisted? blacklist, host - h0, h1, h2, _ = host - blacklist.each do |bhost| - b0, b1, b2, _ = bhost - case host.size - when 1 then return true if b0 === h0 - when 2 then return true if b0 === h0 and b1 === h1 - else return true if b0 === h0 and b1 === h1 and b2 === h2 - end - end - false -end - -def name host - host.reverse.join '.' -end - -desc 'Create a dnsmasq whitelist conf file from hosts.cache' -task :whitelist do - require 'set' - - # Host to direct whitelisted DNS queries - nameserver = '192.168.1.1' - - # Domains that should never enter the whitelist. - # - # Each entry must be an array of three case matchers (i.e. match is done - # with ===) that correspond to the top three levels of a domain name in - # hierarchical order. - blacklist = [ - # ['com', 'google', /\A(www|images|video)\z/], - # ['xxx', /./, /./] - ] - - # Cached hosts as arrays of hierarchical domains - hosts = File.readlines('hosts.cache').map do |l| - l.strip.split.last.split('.').reverse - end - - oldlist = if File.exists? 'whitelist.conf' - File.readlines('whitelist.conf').map { |l| l[%r{/(.*)/}, 1] } - else - [] - end - - # Reduce cached hosts to a set of secondary domains. If the secondary domain - # is blacklisted and the tertiary domain is not, then the tertiary domain is - # added instead. - whitelist = hosts.reduce Set.new(oldlist) do |s, host| - # Don't add TLDs - if host.size < 2 - warn "Rejecting #{name host}" - s - # Try the secondary first - elsif blacklisted? blacklist, host.take(2) - # Then try the tertiary (when in doubt, use brute force) - if blacklisted? blacklist, host.take(3) - warn "Rejecting #{name host}" - s - else - s << name(host.take 3) - end - else - s << name(host.take 2) - end - end - - File.open 'whitelist.conf', 'w' do |f| - f.puts whitelist.map { |host| "server=/#{host}/#{nameserver}" }.sort - end -end diff --git a/release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/conf/dnsmasq.conf b/release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/conf/dnsmasq.conf deleted file mode 100644 index 5b41cbd6c5..0000000000 --- a/release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/conf/dnsmasq.conf +++ /dev/null @@ -1,54 +0,0 @@ -# _________ -# ______ /_________________ __________ ____________ _ -# _ __ / __ \_ ___/ __ `__ \ __ `/ ___/ __ `/ -# / /_/ / / / /(__ ) / / / / // /_/ /(__ )/ /_/ / -# \__,_//_/ /_//____//_/ /_/ /_/ \__,_//____/ \__, / -# /_/ -# guns - -user=dnsmasq -group=dnsmasq - -# Binding rules -# listen-address=127.0.0.1 -# listen-address=10.10.10.1 -no-dhcp-interface=lo -bind-dynamic # Either dynamically bind interfaces (Linux only) -# bind-interfaces # Or bind them statically - -# Caching -cache-size=65536 -hosts-cache=/var/cache/dnsmasq/hosts.cache - -# -# DNS -# - -resolv-file=/etc/dnsmasq/resolv.conf -addn-hosts=/etc/dnsmasq/hosts -no-poll # Don't poll resolv files -domain-needed # Don't forward plain names -bogus-priv # Deny private reverse lookups -local-ttl=86400 # TTL for answers from hosts files and dhcp lease files -stop-dns-rebind # Reject private answers from upstream servers -dns-loop-detect # Detect DNS forwarding loops - -# Domain rules -address=/dev/127.0.0.1 -# server=/lan/192.168.1.1 -# rebind-domain-ok=lan - -# IP sets -# ipset=/hostname/setname - -# Addresses to convert to NXDOMAIN -bogus-nxdomain=64.94.110.11 # Verisign -bogus-nxdomain=67.215.65.132 # OpenDNS guide -bogus-nxdomain=208.67.219.135 # OpenDNS blocked pages - -# -# DHCP -# - -# dhcp-range = set:private, 10.10.10.100, 10.10.10.199, 12h -# dhcp-option = tag:private, option:mtu, 9000 diff --git a/release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/conf/resolv.conf b/release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/conf/resolv.conf deleted file mode 100644 index 234413087b..0000000000 --- a/release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/conf/resolv.conf +++ /dev/null @@ -1,12 +0,0 @@ -### dnsmasq resolvers file - -# Google DNS -# nameserver 8.8.4.4 -# nameserver 8.8.8.8 - -# OpenDNS -# nameserver 208.67.220.220 -# nameserver 208.67.222.222 - -# dnscrypt-proxy -# nameserver 127.0.0.53 diff --git a/release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/dnsmasq.rc b/release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/dnsmasq.rc deleted file mode 100644 index 9b9ca91c4d..0000000000 --- a/release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/dnsmasq.rc +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash - -NAME='dnsmasq' -PROGRAM="%%BINDIR%%/$NAME" -PIDFILE="/var/run/$NAME.pid" -OPTIONS=() - -run() { echo "$@"; "$@"; } -alive() { [[ -e "$PIDFILE" ]] && kill -0 "$(cat "$PIDFILE")" &>/dev/null; } - -start() { - if alive; then - echo "$NAME is already running." - return 1 - elif ! "$PROGRAM" --test; then - return 1 - else - run "$PROGRAM" "${OPTIONS[@]}" - fi -} - -stop() { - if alive; then - run kill $(cat $PIDFILE) - else - echo "$NAME is not running." - return 1 - fi -} - -case $1 in -start) start;; -stop) stop;; -restart) stop; while alive; do sleep 1; done; start;; -*) echo "Usage: ${0##*/} start|stop|restart"; exit 1 -esac diff --git a/release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/dnsmasq.service b/release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/dnsmasq.service deleted file mode 100644 index 045dcd2c8d..0000000000 --- a/release/src-rt-6.x.4708/router/dnsmasq/contrib/guns/dnsmasq.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=A lightweight DHCP and caching DNS server -Requires=network.target -After=network.target - -[Service] -Type=simple -ExecStartPre=%%BINDIR%%/dnsmasq --test -ExecStart=%%BINDIR%%/dnsmasq --keep-in-foreground --listen-address=127.0.0.1 -ExecReload=/usr/bin/kill -HUP $MAINPID - -[Install] -WantedBy=multi-user.target diff --git a/release/src-rt-6.x.4708/router/dnsmasq/dnsmasq.install b/release/src-rt-6.x.4708/router/dnsmasq/dnsmasq.install deleted file mode 100644 index fb5dfc5e99..0000000000 --- a/release/src-rt-6.x.4708/router/dnsmasq/dnsmasq.install +++ /dev/null @@ -1,9 +0,0 @@ -post_install() { - if ! getent passwd dnsmasq &>/dev/null; then - useradd -r -U -c "Local DNS Resolver" -d / -s /usr/bin/nologin dnsmasq - fi -} - -post_upgrade() { - post_install -} diff --git a/release/src-rt-6.x.4708/router/dnsmasq/doc.html b/release/src-rt-6.x.4708/router/dnsmasq/doc.html index 0997f5cce2..54f59bbbd4 100644 --- a/release/src-rt-6.x.4708/router/dnsmasq/doc.html +++ b/release/src-rt-6.x.4708/router/dnsmasq/doc.html @@ -95,4 +95,3 @@ a contribution towards my expenses, please use the donation button below. - diff --git a/release/src-rt-6.x.4708/router/dnsmasq/src/blockdata.c b/release/src-rt-6.x.4708/router/dnsmasq/src/blockdata.c index a240b4d83a..a8fdd59b2e 100644 --- a/release/src-rt-6.x.4708/router/dnsmasq/src/blockdata.c +++ b/release/src-rt-6.x.4708/router/dnsmasq/src/blockdata.c @@ -47,7 +47,7 @@ void blockdata_init(void) blockdata_count = 0; blockdata_hwm = 0; - /* Note that daemon->cachesize is enforced to have non-zero size if OPT_DNSSEC_VALID is set */ + /* Note that daemon->cachesize is enforced to have non-zero size if OPT_DNSSEC_VALID is set */ if (option_bool(OPT_DNSSEC_VALID)) blockdata_expand((daemon->cachesize * 100) / sizeof(struct blockdata)); } @@ -55,9 +55,9 @@ void blockdata_init(void) void blockdata_report(void) { if (option_bool(OPT_DNSSEC_VALID)) - my_syslog(LOG_INFO, _("DNSSEC memory in use %u, max %u, allocated %u"), - blockdata_count * sizeof(struct blockdata), - blockdata_hwm * sizeof(struct blockdata), + my_syslog(LOG_INFO, _("DNSSEC memory in use %u, max %u, allocated %u"), + blockdata_count * sizeof(struct blockdata), + blockdata_hwm * sizeof(struct blockdata), blockdata_alloced * sizeof(struct blockdata)); } diff --git a/release/src-rt-6.x.4708/router/dnsmasq/src/cache.c b/release/src-rt-6.x.4708/router/dnsmasq/src/cache.c index 635e5089ea..4ecd535d0b 100644 --- a/release/src-rt-6.x.4708/router/dnsmasq/src/cache.c +++ b/release/src-rt-6.x.4708/router/dnsmasq/src/cache.c @@ -1439,21 +1439,11 @@ void dump_cache(time_t now) port = prettyprint_addr(&serv->addr, daemon->addrbuff); my_syslog(LOG_INFO, _("server %s#%d: queries sent %u, retried or failed %u"), daemon->addrbuff, port, queries, failed_queries); } - - if (option_bool(OPT_DEBUG) || option_bool(OPT_LOG) || daemon->hosts_cache != NULL) + + if (option_bool(OPT_DEBUG) || option_bool(OPT_LOG)) { struct crec *cache ; int i; - int dumping_hosts = daemon->hosts_cache != NULL; - FILE *hosts_cache = NULL; - if (dumping_hosts) { - hosts_cache = fopen(daemon->hosts_cache, "w"); - if (hosts_cache == NULL) { - dumping_hosts = 0; - my_syslog(LOG_WARNING, "Failed to open hosts cache file: \"%s\"", daemon->hosts_cache); - } - } - my_syslog(LOG_INFO, "Host Address Flags Expires"); for (i=0; iflags & F_REVERSE)) n = ""; p += sprintf(p, "%-30.30s ", sanitise(n)); - if ((cache->flags & F_CNAME)) - { - if (!is_outdated_cname_pointer(cache)) - a = cache_get_cname_target(cache); - if (dumping_hosts) - fprintf(hosts_cache, "#%s\t%s\n", cache_get_cname_target(cache), n); - } + if ((cache->flags & F_CNAME) && !is_outdated_cname_pointer(cache)) + a = sanitise(cache_get_cname_target(cache)); #ifdef HAVE_DNSSEC else if (cache->flags & F_DS) { @@ -1491,8 +1476,6 @@ void dump_cache(time_t now) else if (cache->flags & F_IPV6) inet_ntop(AF_INET6, &cache->addr.addr, a, ADDRSTRLEN); #endif - if (dumping_hosts) - fprintf(hosts_cache, "%s\t%s\n", a, n); } if (cache->flags & F_IPV4) @@ -1525,8 +1508,6 @@ void dump_cache(time_t now) #endif my_syslog(LOG_INFO, daemon->namebuff); } - if (dumping_hosts) - fclose(hosts_cache); } } diff --git a/release/src-rt-6.x.4708/router/dnsmasq/src/dnsmasq.h b/release/src-rt-6.x.4708/router/dnsmasq/src/dnsmasq.h index c9990ac0ea..1651171d01 100644 --- a/release/src-rt-6.x.4708/router/dnsmasq/src/dnsmasq.h +++ b/release/src-rt-6.x.4708/router/dnsmasq/src/dnsmasq.h @@ -995,7 +995,6 @@ extern struct daemon { int back_to_the_future; char *timestamp_file; #endif - char *hosts_cache; /* globally used stuff for DNS */ char *packet; /* packet buffer */ @@ -1357,7 +1356,6 @@ void init_bpf(void); void send_via_bpf(struct dhcp_packet *mess, size_t len, struct in_addr iface_addr, struct ifreq *ifr); void route_init(void); -void route_sock(time_t now); void route_sock(void); #endif diff --git a/release/src-rt-6.x.4708/router/dnsmasq/src/lease.c b/release/src-rt-6.x.4708/router/dnsmasq/src/lease.c index 16a8632c32..774db842d6 100644 --- a/release/src-rt-6.x.4708/router/dnsmasq/src/lease.c +++ b/release/src-rt-6.x.4708/router/dnsmasq/src/lease.c @@ -143,8 +143,8 @@ void lease_init(time_t now) lease->length = ei; #endif #else - /* strictly time_t is opaque, but this hack should work on all sane - systems, even when sizeof(time_t) == 8 */ + /* strictly time_t is opaque, but this hack should work on all sane systems, + even when sizeof(time_t) == 8 */ lease->expires = (time_t)ei; #endif diff --git a/release/src-rt-6.x.4708/router/dnsmasq/src/network.c b/release/src-rt-6.x.4708/router/dnsmasq/src/network.c index ed68681a77..e7722fdce5 100644 --- a/release/src-rt-6.x.4708/router/dnsmasq/src/network.c +++ b/release/src-rt-6.x.4708/router/dnsmasq/src/network.c @@ -1312,7 +1312,7 @@ void mark_servers(int flag) for (serv = daemon->servers; serv; serv = serv->next) { if (serv->flags & flag) - serv->flags |= SERV_MARK; + serv->flags |= SERV_MARK; #ifdef HAVE_LOOP /* Give looped servers another chance */ serv->flags &= ~SERV_LOOP; @@ -1534,8 +1534,8 @@ void check_servers(void) my_syslog(LOG_INFO, _("using nameserver %s#%d for %s %s %s"), daemon->namebuff, port, s1, s2, s3); } #ifdef HAVE_LOOP - else if (serv->flags & SERV_LOOP) - my_syslog(LOG_INFO, _("NOT using nameserver %s#%d - query loop detected"), daemon->namebuff, port); + else if (serv->flags & SERV_LOOP) + my_syslog(LOG_INFO, _("NOT using nameserver %s#%d - query loop detected"), daemon->namebuff, port); #endif else if (serv->interface[0] != 0) my_syslog(LOG_INFO, _("using nameserver %s#%d(via %s)"), daemon->namebuff, port, serv->interface); diff --git a/release/src-rt-6.x.4708/router/dnsmasq/src/option.c b/release/src-rt-6.x.4708/router/dnsmasq/src/option.c index 4e3b4c740b..d8c57d6a6c 100644 --- a/release/src-rt-6.x.4708/router/dnsmasq/src/option.c +++ b/release/src-rt-6.x.4708/router/dnsmasq/src/option.c @@ -154,13 +154,12 @@ struct myoption { #define LOPT_HOST_INOTIFY 342 #define LOPT_DNSSEC_STAMP 343 #define LOPT_TFTP_NO_FAIL 344 -#define LOPT_HOSTCACHE 345 -#define LOPT_MAXPORT 346 -#define LOPT_CPE_ID 347 -#define LOPT_SCRIPT_ARP 348 -#define LOPT_DHCPTTL 349 -#define LOPT_TFTP_MTU 350 - +#define LOPT_MAXPORT 345 +#define LOPT_CPE_ID 346 +#define LOPT_SCRIPT_ARP 347 +#define LOPT_DHCPTTL 348 +#define LOPT_TFTP_MTU 349 + #ifdef HAVE_GETOPT_LONG static const struct option opts[] = #else @@ -322,7 +321,6 @@ static const struct myoption opts[] = { "quiet-dhcp6", 0, 0, LOPT_QUIET_DHCP6 }, { "quiet-ra", 0, 0, LOPT_QUIET_RA }, { "dns-loop-detect", 0, 0, LOPT_LOOP_DETECT }, - { "hosts-cache", 1, 0, LOPT_HOSTCACHE }, { "script-arp", 0, 0, LOPT_SCRIPT_ARP }, { "dhcp-ttl", 1, 0 , LOPT_DHCPTTL }, { NULL, 0, 0, 0 } @@ -495,8 +493,7 @@ static struct { { LOPT_LOCAL_SERVICE, OPT_LOCAL_SERVICE, NULL, gettext_noop("Accept queries only from directly-connected networks."), NULL }, { LOPT_LOOP_DETECT, OPT_LOOP_DETECT, NULL, gettext_noop("Detect and remove DNS forwarding loops."), NULL }, { LOPT_IGNORE_ADDR, ARG_DUP, "", gettext_noop("Ignore DNS responses containing ipaddr."), NULL }, - { LOPT_HOSTCACHE, ARG_ONE, "", gettext_noop("Dump cached A records to on SIGUSR1"), NULL }, - { LOPT_DHCPTTL, ARG_ONE, "", gettext_noop("Set TTL in DNS responses with DHCP-derived addresses."), NULL }, + { LOPT_DHCPTTL, ARG_ONE, "", gettext_noop("Set TTL in DNS responses with DHCP-derived addresses."), NULL }, { 0, 0, NULL, NULL, NULL } }; @@ -2358,7 +2355,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma newlist = opt_malloc(sizeof(struct server)); memset(newlist, 0, sizeof(struct server)); #ifdef HAVE_LOOP - newlist->uid = rand32(); + newlist->uid = rand32(); #endif } @@ -4048,12 +4045,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma break; } #endif - case LOPT_HOSTCACHE: /* --hosts-cache */ - { - if (daemon->hosts_cache == NULL) - daemon->hosts_cache = opt_string_alloc(arg); - break; - } + default: ret_err(_("unsupported option (check that dnsmasq was compiled with DHCP/TFTP/DNSSEC/DBus support)")); diff --git a/release/src-rt-6.x.4708/router/dnsmasq/src/radv.c b/release/src-rt-6.x.4708/router/dnsmasq/src/radv.c index e723d9fd38..749b666488 100644 --- a/release/src-rt-6.x.4708/router/dnsmasq/src/radv.c +++ b/release/src-rt-6.x.4708/router/dnsmasq/src/radv.c @@ -579,7 +579,7 @@ static int add_prefixes(struct in6_addr *local, int prefix, { context->saved_valid = valid; - if (context->flags & CONTEXT_RA) + if (context->flags & CONTEXT_RA) { do_slaac = 1; if (context->flags & CONTEXT_DHCP) @@ -598,8 +598,8 @@ static int add_prefixes(struct in6_addr *local, int prefix, param->other = 1; } - /* Configured to advertise router address, not prefix. See RFC 3775 7.2 - In this case we do all addresses associated with a context, + /* Configured to advertise router address, not prefix. See RFC 3775 7.2 + In this case we do all addresses associated with a context, hence the real_prefix setting here. */ if (context->flags & CONTEXT_RA_ROUTER) { diff --git a/release/src-rt-6.x.4708/router/dnsmasq/src/rfc2131.c b/release/src-rt-6.x.4708/router/dnsmasq/src/rfc2131.c index 625214ef16..b7c167ebea 100644 --- a/release/src-rt-6.x.4708/router/dnsmasq/src/rfc2131.c +++ b/release/src-rt-6.x.4708/router/dnsmasq/src/rfc2131.c @@ -1559,7 +1559,6 @@ static void log_packet(char *type, void *addr, unsigned char *ext_mac, int mac_len, char *interface, char *string, char *err, u32 xid) { struct in_addr a; - if (!err && !option_bool(OPT_LOG_OPTS) && option_bool(OPT_QUIET_DHCP)) return; diff --git a/release/src-rt-6.x.4708/router/dnsmasq/src/util.c b/release/src-rt-6.x.4708/router/dnsmasq/src/util.c index 6cd23f5acc..93b24f5181 100644 --- a/release/src-rt-6.x.4708/router/dnsmasq/src/util.c +++ b/release/src-rt-6.x.4708/router/dnsmasq/src/util.c @@ -83,14 +83,14 @@ unsigned short rand16(void) u32 rand32(void) { - if (!outleft) + if (!outleft) { if (!++in[0]) if (!++in[1]) if (!++in[2]) ++in[3]; surf(); outleft = 8; } - - return out[--outleft]; + + return out[--outleft]; } u64 rand64(void) -- 2.11.4.GIT