dnsmasq with --interface exits immediately if the interface does not exist yet
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dnsmasq (Ubuntu) |
Fix Released
|
Wishlist
|
Mathieu Trudel-Lapierre |
Bug Description
Binary package hint: dnsmasq
When dnsmasq is used with the --interface argument, and the selected interface is not yet available dnsmasq exits immediately. This prevents some use cases, including:
1) managed virtual environments bringing up virbr0 interfaces (libvirt has commented code disabling this to avoid this premature exit)
2) Use with usb0 networks for hotplug of portable devices for ad-hoc network access
3) Use with usb networking adaptors to provide occasional ad-hoc networks on demand
This is more important when one is using the DHCP or TFTP features of dnsmasq, as in those cases one may wish to specifcally bind ony to some known interface considered safe for these services (virbr0 and usb0 being networks that are rarely used to reach gateways by systems that would run dnsmasq as a system service).
Related branches
summary: |
- dnsmasq exits using --interface if the interface does not exist yet + dnsmasq with --interface exits immediately if the interface does not + exist yet |
Changed in dnsmasq (Ubuntu): | |
status: | Confirmed → In Progress |
assignee: | nobody → Mathieu Trudel-Lapierre (mathieu-tl) |
From a brief look at the code, it appears that the relevant section is in src/dnsmasq.c : 169-189. In this mode, if unable to access an interface because it doesn't exist, dnsmasq should poll the interface for a configurable timeout to see if it becomes available before quitting. As there may be multiple interfaces, implementing this as a push-to- back-of- queue delay until there is only one interface polling will ensure that the majority of intentionally specified interfaces come up as quickly as if all interfaces existed.