[Dnsmasq-discuss] Set environment variable for dhcp-script

Geert Stappers stappers at stappers.nl
Mon Aug 13 22:13:43 BST 2018


On Mon, Aug 13, 2018 at 06:17:59PM +0000, Daniel Weller wrote:
> Geert Stappers
> >>>>>
> >>>>>  What is the original problem?
> >>>>>
>
> I am trying to pass DHCP header option 161 OPTION_MUD_URL_V4 to the
> dhcp-script. Doing so would allow for the use of dnsmasq to communicate
> a MUD url via DHCP to a mud manager.

Quoting https://osmud.org/
| How does MUD work?
|
| A MUD compliant network includes a MUD manager that communicates with
| network services like DHCP allowing the MUD manager to be informed
| of when devices enter and leave the network. Devices that provide
| additional information and context about themselves via MUD specified
| methods when seen on the network are considered to be ?MUD Enabled
| Devices?. The MUD manager uses this context to obtain/download
| information from the manufacturer defining allowed behaviors for
| specific devices. The MUD manager uses the information (stored in a MUD
| file) to communicate with network services including firewall, DNS,
| and DHCP services and/or other services including network monitoring
| software to communicate allowed behaviors of individual devices.

And the MUD URL DHCP Option is documented
at https://tools.ietf.org/html/draft-ietf-opsawg-mud-25#section-10


Sounds like a valid extension of dnsmasq. But I'm worn out. It took three
attempts to get an answer what the original problem is. Hopefully there
will be a fresh start like:

| Hello,
|
| I am trying to set a DNSMASQ_MUD_URL variable from inside dnsmasq- giving
| the script being called by dhcp-script access to that variable.
| MUD is Manufacturer Usage Description ( https://osmud.org/ )
|
| Find attached a patch with the extra source code.
|
| However, when it forks I am unable to follow the child process
| in my debugger. I have tried setting "set follow-fork-mode <mode>" &
| "set detach-on-fork <mode>" but after the process forks- it seems to
| just hang and never be called.
|
| Also I've got my local variable inside the lease struct and passed to
| queue_script() in helper.c.
|
| Any ideas how to debug the dhcp-script child process or where I should
| set the environment variable to allow the script called by dhcp-script
| to read this environment variable?



Groeten
Geert Stappers
-- 
Leven en laten leven



More information about the Dnsmasq-discuss mailing list