History | View | Annotate | Download (25.1 kB)
Fix typo (vaildate -> validate)
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Code refactoring to remove overlong lines
Improve error handling
Catch and handle specific exception families where possible and provideadditional information.
Merge previous changes
Conflicts: nfdhcpd: merge
Implement IPv6 RDNSS
Add support for ICMPv6 RDNSS (RFC 5006) to advertise DNS servers over ICMPv6router advertisements.
DHCP: use nameservers from config
Use the DNS servers from the config file for DHCP replies.
Disable sending periodic RAs when IPv6 is disabled
Disabling IPv6 from the configuration file causes the server to not respond toNS and RS, however it still tried to send out periodic RAs (which was a noop).We explicitly set the timeout of select() to None to avoid this, when IPv6 is...
Add configurationf file validation
Add a specification of the configuration file and runtime validation, usingconfigobj's validate.Validator and custom checks for the nameserver lists.
Add configuration file support
Add configuration file parsing using python-configobj. All command line optionsexcept -d and -f have been moved to the configuration file.
A sample configuration file with all accepted options has been added as well.
Warning: validation and type casting is still missing....
Open the logfile after changing uid and set umask
Set the process' umask in daemon.DaemonContext to 0022 (default was0).
Open the logfile after dropping privileges, so that it is created withproper perimissions (this also ensures that log rotation will work)....
Refactor the main loop code and increase RA period
Increase RA period to 300s by default
Refactor the main loop to check only once for timeout expiration. Thisfixes spurious RA emission because we forgot to properly reset thestart timer.
Use a separate thread for periodic RAs
Periodic RAs can take a long time with many interfaces. The bottleneckseems to lie in bind() send send() with AF_PACKET sockets. So, we spawna separate thread to be able to handle requests in the mean time.
Gracefully handle ICMPv6 NS w/o SrcLLAddr option
Neighbour solicitations sent during interface configuration do notinclude a Source Link-Layer Address option. We ignore them as weshouldn't (and can't) reply anyway.
Warn on NFQUEUE exception
Warn if anything goes wrong during select()
Whitespace cleanup
Gracefully handle dead interfaces on periodic RA
Remove any interfaces that are not there during periodic RA emission.
Rename nfdhcp.py to nfdhcpd