Re: [Dnsmasq-discuss] IPv6 Router Advertisements eating a CPU Core + Constantly being Multicasted

2019-09-11 Thread Cooper Lees
Hi,

Many thanks for your suggestions.

Maybe I was not clear enough. With `dhcp-range=2601:647:4d01:fbf::,ra-names` in 
the config causes 'top' to show a lot of CPU used (>90%):
```
19492 dnsmasq   20   0   11076   2536   2228 R  93.4   0.1 815:27.43 
/usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r 
/run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new 
--local-service
```
AND tcpdump shows a barrage of RAs being advertised:
```
06:39:00.390680 IP6 fe80::dea6:32ff:fe02:b43d > ff02::1: ICMP6, router 
advertisement, length 88
06:39:00.391455 IP6 fe80::dea6:32ff:fe02:b43d > ff02::1: ICMP6, router 
advertisement, length 88
06:39:00.392017 IP6 fe80::dea6:32ff:fe02:b43d > ff02::1: ICMP6, router 
advertisement, length 88
06:39:00.392564 IP6 fe80::dea6:32ff:fe02:b43d > ff02::1: ICMP6, router 
advertisement, length 88
06:39:00.393103 IP6 fe80::dea6:32ff:fe02:b43d > ff02::1: ICMP6, router 
advertisement, length 88
```
- Please look at the timestamps here
- Milliseconds apart 

I've replied to everything else in line. I guess it's going to be time to dig 
into the source code here if nothing else in my config looks outside the 
ordinary.

Cheers,
Cooper

> On Aug 4, 2019, at 11:29 PM, Geert Stappers  wrote:
> 
> On Sun, Aug 04, 2019 at 03:05:45PM -0700, Cooper Lees wrote:
>> Hello,
>> 
>> I'm running dnsmasq 2.80 on a Raspberry PI and when I enable IPv6
>> Router Advertisements on even one interface the CPU usage pins a
>> core with continually advertising RAs. Logs and tcpdump confirm it's
>> something to do with enabling IPv6 RAs / SLAAC on an interface (when
>> I remove CPU goes right back down to where I'd imagine this daemon to
>> be on a ~10 node home network). I've tried to tune the advertisement
>> to every 4 seconds, but it seems to have no effect. I've also tried
>> TRUNK/HEAD and it reproduces with my config. I've added the options +
>> config used below to help provide a reproducible setup.
>> 
>> Any suggestions I could try / do or is this indeed a bug with dnsmasq?
>> 
>> ./src/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r 
>> /run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new 
>> --local-service
> 
> The`,.dpkg-dist,.dpkg-old,.dpkg-new` somewhat odd.
> Probably a side effect of some wildcard expansion.
> 
> Check what is inside those  .dpkg-distl.dpkg-old .dpkg-new files.
> Remove them if there is nothing usefull in. And surely remove
> them when there is only duplicate configuration.

This seems to be a default with the raspbian install - There is nothing in 
/etc/dnsmasq.d
```
cooper@home:~ $ find /etc/dnsmasq.d
/etc/dnsmasq.d
/etc/dnsmasq.d/README
```

Removing these and running the daemon has no effect.
```
31737 dnsmasq   20   02244120  0 R  85.8   0.0   0:15.87 
./src/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r 
/run/dnsmasq/resolv.conf --local-service
```

> 
> 
>> ```
>> Log from starting with HEAD:
>> Aug  4 14:44:30 home dnsmasq[19340]: started, version 2.80-58-g3052ce2 
>> cachesize 150
>> Aug  4 14:44:30 home dnsmasq[19340]: compile time options: IPv6 GNU-getopt 
>> no-DBus no-UBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset 
>> auth no-DNSSEC loop-detect inotify dumpfile
>> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: DHCP, IP range 10.6.9.10 -- 
>> 10.6.9.200, lease time 1d
>> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: DHCP, IP range 192.168.107.10 -- 
>> 192.168.107.100, lease time 1h
>> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: DHCPv4-derived IPv6 names on 
>> 2601:647:4d01:fbf::
>> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: router advertisement on 
>> 2601:647:4d01:fbf::
>> Aug  4 14:44:30 home dnsmasq[19340]: reading /run/dnsmasq/resolv.conf
>> Aug  4 14:44:30 home dnsmasq[19340]: using nameserver 75.75.75.75#53
>> Aug  4 14:44:30 home dnsmasq[19340]: using nameserver 75.75.76.76#53
>> Aug  4 14:44:30 home dnsmasq[19340]: read /etc/hosts - 6 addresses
>> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: SLAAC-CONFIRM(eth0.69) 
>> 2601:647:4d01:fbf:fea1:83ff:fe5e:d592 amazon-057c5fa7e
>> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: SLAAC-CONFIRM(eth0.69) 
>> 2601:647:4d01:fbf:36d2:70ff:feb1:f402 amazon-9ad27ed72
>> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: SLAAC-CONFIRM(eth0.69) 
>> 2601:647:4d01:fbf:8a71:e5ff:fedb:b5e6 amazon-77495bfb3
>> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: DHCPDISCOVER(eth0.69) 
>> dc:a2:66:59:6d:1f
>> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: DHCPOFFER(eth0.69) 10.6.9.189 
>> dc:a2:66:59:6d:1f
>> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: DHCPREQUEST(eth0.69) 10.6.9.189 
>> dc:a2:66:59:6d:1f
>> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: DHCPACK(eth0.69) 10.6.9.189 
>> dc:a2:66:59:6d:1f
>> ```
> 
> Nothing that indicates a 25% CPU load.
- This is because I added the `quiet-ra` option 
- Otherwise it's just 1s `dnsmasq-dhcp[19424]: RTR-ADVERT(eth0.69) 
2601:647:4d01:fbf::` lines in logs

> 
>> 
>> Log Messages (without quiet-ra)
>> ```
>> Aug  4 14:52:30 home dnsmasq-dhcp[19424]: R

Re: [Dnsmasq-discuss] IPv6 Router Advertisements eating a CPU Core + Constantly being Multicasted

2019-08-05 Thread Geert Stappers
On Mon, Aug 05, 2019 at 06:44:46AM -0700, Cooper Lees wrote:
> On Aug 4, 2019, at 11:29 PM, Geert Stappers wrote:
> > On Sun, Aug 04, 2019 at 03:05:45PM -0700, Cooper Lees wrote:
> >> 
   
> >> 
> >> Any suggestions I could try / do or is this indeed a bug with dnsmasq?
> >> 
> >> ./src/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r 
> >> /run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new 
> >> --local-service
> > 
> > The`,.dpkg-dist,.dpkg-old,.dpkg-new` somewhat odd.
> > Probably a side effect of some wildcard expansion.
> > 
> > Check what is inside those  .dpkg-distl.dpkg-old .dpkg-new files.
> > Remove them if there is nothing usefull in. And surely remove
> > them when there is only duplicate configuration.
> 
> This seems to be a default with the raspbian install - There is nothing in 
> /etc/dnsmasq.d
> ```
> cooper@home:~ $ find /etc/dnsmasq.d
> /etc/dnsmasq.d
> /etc/dnsmasq.d/README
> ```
> 
> Removing these and running the daemon has no effect.
> ```
> 31737 dnsmasq   20   02244120  0 R  85.8   0.0   0:15.87 
> ./src/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r 
> /run/dnsmasq/resolv.conf --local-service
> ```

I do see the "85.8 procent CPU load".
And that the .dpkg-distl.dpkg-old .dpkg-new files are gone.
 
> > 
> >> ```
> >> Log from starting with HEAD:
 15 log entries 
> >> ```
> > 
> > Nothing that indicates a 25% CPU load.
> - This is because I added the `quiet-ra` option 
> - Otherwise it's just 1s `dnsmasq-dhcp[19424]: RTR-ADVERT(eth0.69) 
> 2601:647:4d01:fbf::` lines in logs
> 
> > 
> >> 
> >> Log Messages (without quiet-ra)
> >> ```
> >> Aug  4 14:52:30 home dnsmasq-dhcp[19424]: RTR-ADVERT(eth0.69) 
> >> 2601:647:4d01:fbf::
> >> ```
> > 
> > Even less
> > 
> > Previously
> >> core with continually advertising RAs. Logs and tcpdump confirm it's
> > 
> > Without flooding this mailinglist,
> > please share somehow that data with us.
> > 
> 
> With `dhcp-range=2601:647:4d01:fbf::,ra-names` in the config causes
> 'top' to show a lot of CPU used (>90%):
> ```
> 19492 dnsmasq   20   0   11076   2536   2228 R  93.4   0.1 815:27.43 
> /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r 
> /run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new 
> --local-service
> ```
> AND tcpdump shows a barrage of RAs being advertised:
> ```
> 06:39:00.390680 IP6 fe80::dea6:32ff:fe02:b43d > ff02::1: ICMP6, router 
> advertisement, length 88
> 06:39:00.391455 IP6 fe80::dea6:32ff:fe02:b43d > ff02::1: ICMP6, router 
> advertisement, length 88
> 06:39:00.392017 IP6 fe80::dea6:32ff:fe02:b43d > ff02::1: ICMP6, router 
> advertisement, length 88
> 06:39:00.392564 IP6 fe80::dea6:32ff:fe02:b43d > ff02::1: ICMP6, router 
> advertisement, length 88
> 06:39:00.393103 IP6 fe80::dea6:32ff:fe02:b43d > ff02::1: ICMP6, router 
> advertisement, length 88
> ```
> - Please look at the timestamps here
> - Milliseconds apart 
 
Acknowledge on that


> >> Config:
> >> ```
> >> # Never forward plain names (without a dot or domain part)
> >> bogus-priv
> >> # Never forward addresses in the non-routed address spaces.
> >> domain-needed
> >> 
> >> # Delays sending DHCPOFFER and proxydhcp replies for at least the 
> >> specified number of seconds.
> >> dhcp-mac=set:client_is_a_pi,B8:27:EB:*:*:*
> >> dhcp-reply-delay=tag:client_is_a_pi,2
> > 
> > Why that delay?
> > What is the effect of removing it?
> - This is a default in the raspbian dnsmasq install
> - Removing this has no effect
 
Acknowledge


> >> # List of all the interfaces for dnsmasq to listen on
> >> # Sample interface line: interface=eth0
> >> interface=eth0
> >> interface=eth0.69
> >> 
> >> # v4 - manually set these options
> >> dhcp-option=option:domain-search,cooperlees.com
> >> dhcp-option=option:router,10.6.9.2
> >> dhcp-range=eth0,192.168.107.10,192.168.107.100,1h
> >> dhcp-range=eth0.69,10.6.9.10,10.6.9.200,24h
> >> 
> >> 
> >> # v6 Sateless RA + Names
> >> # Sample DHCP range line: dhcp-range=2601:647:4d01:fbf::, ra-stateless, 
> >> ra-names
> >> #dhcp-range=2601:647:4d01:fbf::,ra-stateless, ra-names
> >> dhcp-range=2601:647:4d01:fbf::,ra-names
> >> #ra-param=eth0.69,4
> >> quiet-ra
> >> ```
> >> 
> >> Thanks,
> >> Cooper
> > 
> > Please keep us, this mailinglist, informed.
> > 
> 
> I guess it's going to be time to dig into the source code here if
> nothing else in my config looks outside the ordinary.

Configuration
> >> dhcp-range=eth0,192.168.107.10,192.168.107.100,1h
> >> dhcp-range=eth0.69,10.6.9.10,10.6.9.200,24h
> >> dhcp-range=2601:647:4d01:fbf::,ra-names


Manualpage
| 
dhcp-range=[tag:[,tag:],][set:,][,|][,[,]][,]
| 
dhcp-range=[tag:[,tag:],][set:,][,|constructor:][,][,][,] 

Untested new configuration
| dhcp-range=eth0,192.168.107.10,192.168.107.100,1h
| dhcp-range=eth0.69,10.6.9.10,10.6.9.200,24h
| dhcp-range=2601:647:4d01:fbf::,constructor:eth0,ra-names,80
| dhcp-range=2601:647:4d01:fbf:8000::,constructor:eth0.69,ra-names,80

The idea is to have a 

Re: [Dnsmasq-discuss] IPv6 Router Advertisements eating a CPU Core + Constantly being Multicasted

2019-08-04 Thread Geert Stappers
On Sun, Aug 04, 2019 at 03:05:45PM -0700, Cooper Lees wrote:
> Hello,
> 
> I'm running dnsmasq 2.80 on a Raspberry PI and when I enable IPv6
> Router Advertisements on even one interface the CPU usage pins a
> core with continually advertising RAs. Logs and tcpdump confirm it's
> something to do with enabling IPv6 RAs / SLAAC on an interface (when
> I remove CPU goes right back down to where I'd imagine this daemon to
> be on a ~10 node home network). I've tried to tune the advertisement
> to every 4 seconds, but it seems to have no effect. I've also tried
> TRUNK/HEAD and it reproduces with my config. I've added the options +
> config used below to help provide a reproducible setup.
> 
> Any suggestions I could try / do or is this indeed a bug with dnsmasq?
> 
> ./src/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r 
> /run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new 
> --local-service
 
The`,.dpkg-dist,.dpkg-old,.dpkg-new` somewhat odd.
Probably a side effect of some wildcard expansion.

Check what is inside those  .dpkg-distl.dpkg-old .dpkg-new files.
Remove them if there is nothing usefull in. And surely remove
them when there is only duplicate configuration.


> ```
> Log from starting with HEAD:
> Aug  4 14:44:30 home dnsmasq[19340]: started, version 2.80-58-g3052ce2 
> cachesize 150
> Aug  4 14:44:30 home dnsmasq[19340]: compile time options: IPv6 GNU-getopt 
> no-DBus no-UBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset 
> auth no-DNSSEC loop-detect inotify dumpfile
> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: DHCP, IP range 10.6.9.10 -- 
> 10.6.9.200, lease time 1d
> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: DHCP, IP range 192.168.107.10 -- 
> 192.168.107.100, lease time 1h
> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: DHCPv4-derived IPv6 names on 
> 2601:647:4d01:fbf::
> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: router advertisement on 
> 2601:647:4d01:fbf::
> Aug  4 14:44:30 home dnsmasq[19340]: reading /run/dnsmasq/resolv.conf
> Aug  4 14:44:30 home dnsmasq[19340]: using nameserver 75.75.75.75#53
> Aug  4 14:44:30 home dnsmasq[19340]: using nameserver 75.75.76.76#53
> Aug  4 14:44:30 home dnsmasq[19340]: read /etc/hosts - 6 addresses
> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: SLAAC-CONFIRM(eth0.69) 
> 2601:647:4d01:fbf:fea1:83ff:fe5e:d592 amazon-057c5fa7e
> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: SLAAC-CONFIRM(eth0.69) 
> 2601:647:4d01:fbf:36d2:70ff:feb1:f402 amazon-9ad27ed72
> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: SLAAC-CONFIRM(eth0.69) 
> 2601:647:4d01:fbf:8a71:e5ff:fedb:b5e6 amazon-77495bfb3
> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: DHCPDISCOVER(eth0.69) 
> dc:a2:66:59:6d:1f
> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: DHCPOFFER(eth0.69) 10.6.9.189 
> dc:a2:66:59:6d:1f
> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: DHCPREQUEST(eth0.69) 10.6.9.189 
> dc:a2:66:59:6d:1f
> Aug  4 14:44:30 home dnsmasq-dhcp[19340]: DHCPACK(eth0.69) 10.6.9.189 
> dc:a2:66:59:6d:1f
> ```

Nothing that indicates a 25% CPU load.

> 
> Log Messages (without quiet-ra)
> ```
> Aug  4 14:52:30 home dnsmasq-dhcp[19424]: RTR-ADVERT(eth0.69) 
> 2601:647:4d01:fbf::
> ```

Even less

Previously
> core with continually advertising RAs. Logs and tcpdump confirm it's

Without flooding this mailinglist,
please share somehow that data with us.



> Config:
> ```
> # Never forward plain names (without a dot or domain part)
> bogus-priv
> # Never forward addresses in the non-routed address spaces.
> domain-needed
> 
> # Delays sending DHCPOFFER and proxydhcp replies for at least the specified 
> number of seconds.
> dhcp-mac=set:client_is_a_pi,B8:27:EB:*:*:*
> dhcp-reply-delay=tag:client_is_a_pi,2

Why that delay?
What is the effect of removing it?

 
> # List of all the interfaces for dnsmasq to listen on
> # Sample interface line: interface=eth0
> interface=eth0
> interface=eth0.69
> 
> # v4 - manually set these options
> dhcp-option=option:domain-search,cooperlees.com
> dhcp-option=option:router,10.6.9.2
> dhcp-range=eth0,192.168.107.10,192.168.107.100,1h
> dhcp-range=eth0.69,10.6.9.10,10.6.9.200,24h
> 
> 
> # v6 Sateless RA + Names
> # Sample DHCP range line: dhcp-range=2601:647:4d01:fbf::, ra-stateless, 
> ra-names
> #dhcp-range=2601:647:4d01:fbf::,ra-stateless, ra-names
> dhcp-range=2601:647:4d01:fbf::,ra-names
> #ra-param=eth0.69,4
> quiet-ra
> ```
> 
> Thanks,
> Cooper

Please keep us, this mailinglist, informed.

After all is a unknow bug far worse then ten known bugs.
> Any suggestions I could try / do or is this indeed a bug with dnsmasq?



Groeten
Geert Stappers
-- 
Leven en laten leven

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss