Possibility of improving default udhcpc/odhcp6c user script mechanism

The amount of space used by such a file is negligible even for OpenWrt, especially because it is in the squashfs (compressed/readonly) partition.

If you want to make a PR I think you should hook this up to the Hotplug system, OpenWrt has consolidated all events to call user-created or package-added scripts from there https://openwrt.org/docs/guide-user/base-system/hotplug?s[]=hotplug

Afaik it has a folder for dhcp-related events already, but it was working only with ipv4. I think that dnsmasq has a similar setup where every change the dnsmasq binary calls a special script, and in that file in OpenWrt there is the hook to call the stuff in Hotplug folders, so you can use that as a base

This should be the file called by dnsmasq to trigger hotplug scripts https://github.com/openwrt/openwrt/blob/master/package/network/services/dnsmasq/files/dhcp-script.sh

Here is the old thread where we discussed this in the past Udhcpc.user script documentation and how to hotplug for DHCP events - #10 by bobafetthotmail

1 Like