openwrt / packages

Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
GNU General Public License v2.0
4.02k stars 3.49k forks source link

stubby: trigger option and multiple WAN interfaces #15723

Closed jamesmacwhite closed 3 years ago

jamesmacwhite commented 3 years ago

Maintainer: @jonathanunderwood Environment: OpenWrt 19.07.7 mvebu Linksys WRT3200ACM

Description:

For environments that have multiple WAN interfaces, it might be advantageous to have the trigger option support multiple WAN interfaces, specified as each interface name such as wan wanb wanc

https://forum.openwrt.org/t/stubby-option-trigger-help/56694

The original poster in the OpenWrt forum thread highlights that the trigger option doesn't seem to work with multiple WANs however the following modification to the init script, would allow this:

https://github.com/openwrt/packages/blob/master/net/stubby/files/stubby.init#L271

Replaces with a for loop for each wan interface referenced:

for trigger_item in $trigger
do
    procd_add_interface_trigger "interface.*.up" "$trigger_item" "$stubby_init" start
done

There are situations that with multiple WAN interfaces and having something like mwan3 enabled, stubby may not be reloaded when a WAN interface goes down and hence this will cause DNS lookups to time out.

jamesmacwhite commented 3 years ago

All credit to @deaddy64 for the suggested code change, as per the original thread, I thought it was worth highlighting here for potential inclusion into the main package.

jonathanunderwood commented 3 years ago

Thanks @jamesmacwhite . I am no longer maintaining this package, but I am sure that if you prepare a PR, maintainers will merge it.

jamesmacwhite commented 3 years ago

@jonathanunderwood Thanks for letting me know. I'll close this and open a PR.