Re: [Dnsmasq-discuss] Set environment variable for dhcp-script
On Mon, Aug 13, 2018 at 06:17:59PM +, 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 " & | "set detach-on-fork " 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 ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Set environment variable for dhcp-script
Ok sure. 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. Thanks, Daniel From: Dnsmasq-discuss on behalf of Geert Stappers Sent: Saturday, August 11, 2018 8:13:11 AM To: dnsmasq-discuss@lists.thekelleys.org.uk Subject: Re: [Dnsmasq-discuss] Set environment variable for dhcp-script On Sat, Aug 11, 2018 at 01:09:53AM +, Daniel Weller wrote: > From: Geert Stappers Sent: Friday, August 10, 2018 7:20:50 AM > > On Fri, Aug 10, 2018 at 09:11:48AM +, Daniel Weller wrote: > > > I am trying to pass a DHCP header value that is read from the client > > > DHCP request- to the file being called by dhcp-script=. The > > > easiest way to do that I think is to set an environment variable that > > > the dhcp-script= has access to while executing. > > > > What is the original problem? > > > > So let us know which DNSMASQ_... you miss. > > > > That is the original problem. Just trying to pass a custom DHCP > header option to the dhcp-scrip=. What do you mean by "So let > us know which DNSMASQ_... you miss" ? I understand there is a lot of > DNSMASQ_... options on the man page under dhcp-script. None let you > grab all of the DHCP headers passed from the client to the server. > , I was hoping for an answer like } I do mis DNSMASQ_FOO. FOO is a custom DHCP option, being option number } Having DNSMASQ_FOO in dhcp-script would solve the problem of ... Without knowing the original problem is not possible to provide an alternative solution. Without knowng the DHCP option number is not possible to advice which existing DHCP option to use as starting point for the currently missing source code for putting FOO into environment for dhcp-script. Groeten Geert Stappers -- Leven en laten leven ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Set environment variable for dhcp-script
On Sat, Aug 11, 2018 at 01:09:53AM +, Daniel Weller wrote: > From: Geert Stappers Sent: Friday, August 10, 2018 7:20:50 AM > > On Fri, Aug 10, 2018 at 09:11:48AM +, Daniel Weller wrote: > > > I am trying to pass a DHCP header value that is read from the client > > > DHCP request- to the file being called by dhcp-script=. The > > > easiest way to do that I think is to set an environment variable that > > > the dhcp-script= has access to while executing. > > > > What is the original problem? > > > > So let us know which DNSMASQ_... you miss. > > > > That is the original problem. Just trying to pass a custom DHCP > header option to the dhcp-scrip=. What do you mean by "So let > us know which DNSMASQ_... you miss" ? I understand there is a lot of > DNSMASQ_... options on the man page under dhcp-script. None let you > grab all of the DHCP headers passed from the client to the server. > , I was hoping for an answer like } I do mis DNSMASQ_FOO. FOO is a custom DHCP option, being option number } Having DNSMASQ_FOO in dhcp-script would solve the problem of ... Without knowing the original problem is not possible to provide an alternative solution. Without knowng the DHCP option number is not possible to advice which existing DHCP option to use as starting point for the currently missing source code for putting FOO into environment for dhcp-script. Groeten Geert Stappers -- Leven en laten leven ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Set environment variable for dhcp-script
That is the original problem. Just trying to pass a custom DHCP header option to the dhcp-scrip=. What do you mean by "So let us know which DNSMASQ_... you miss" ? I understand there is a lot of DNSMASQ_... options on the man page under dhcp-script. None let you grab all of the DHCP headers passed from the client to the server. Thanks, Daniel From: Dnsmasq-discuss on behalf of Geert Stappers Sent: Friday, August 10, 2018 7:20:50 AM To: dnsmasq-discuss@lists.thekelleys.org.uk Subject: Re: [Dnsmasq-discuss] Set environment variable for dhcp-script On Fri, Aug 10, 2018 at 09:11:48AM +, Daniel Weller wrote: > From: Geert Stappers, Sent: Friday, August 10, 2018 1:51:26 AM > > On Thu, Aug 09, 2018 at 08:38:33PM +, Daniel Weller wrote: > > > Hello, > > > > > > I am trying to set an environment variable from inside dnsmasq- giving > > > the script being called by dhcp-script access to that variable. I > > > think the location to do this is inside helper.c in the create_helper() > > > function. However, when it forks I am unable to follow the child process > > > in my debugger. I have tried setting "set follow-fork-mode " & > > > "set detach-on-fork " 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? > > > > What is the original problem? > > > I am trying to pass a DHCP header value that is read from the client > DHCP request- to the file being called by dhcp-script=. The > easiest way to do that I think is to set an environment variable that > the dhcp-script= has access to while executing. > What is the original problem? So let us know which DNSMASQ_... you miss. ( check manual for DNSMASQ_ ) Groeten Geert Stappers -- Leven en laten leven ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Set environment variable for dhcp-script
On Fri, Aug 10, 2018 at 09:11:48AM +, Daniel Weller wrote: > From: Geert Stappers, Sent: Friday, August 10, 2018 1:51:26 AM > > On Thu, Aug 09, 2018 at 08:38:33PM +, Daniel Weller wrote: > > > Hello, > > > > > > I am trying to set an environment variable from inside dnsmasq- giving > > > the script being called by dhcp-script access to that variable. I > > > think the location to do this is inside helper.c in the create_helper() > > > function. However, when it forks I am unable to follow the child process > > > in my debugger. I have tried setting "set follow-fork-mode " & > > > "set detach-on-fork " 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? > > > > What is the original problem? > > > I am trying to pass a DHCP header value that is read from the client > DHCP request- to the file being called by dhcp-script=. The > easiest way to do that I think is to set an environment variable that > the dhcp-script= has access to while executing. > What is the original problem? So let us know which DNSMASQ_... you miss. ( check manual for DNSMASQ_ ) Groeten Geert Stappers -- Leven en laten leven ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Set environment variable for dhcp-script
I am trying to pass a DHCP header value that is read from the client DHCP request- to the file being called by dhcp-script=. The easiest way to do that I think is to set an environment variable that the dhcp-script= has access to while executing. Thanks, Daniel From: Dnsmasq-discuss on behalf of Geert Stappers Sent: Friday, August 10, 2018 1:51:26 AM To: dnsmasq-discuss@lists.thekelleys.org.uk Subject: Re: [Dnsmasq-discuss] Set environment variable for dhcp-script On Thu, Aug 09, 2018 at 08:38:33PM +, Daniel Weller wrote: > Hello, > > I am trying to set an environment variable from inside dnsmasq- giving > the script being called by dhcp-script access to that variable. I > think the location to do this is inside helper.c in the create_helper() > function. However, when it forks I am unable to follow the child process > in my debugger. I have tried setting "set follow-fork-mode " & > "set detach-on-fork " 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? What is the original problem? Groeten Geert Stappers -- Leven en laten leven ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Set environment variable for dhcp-script
On Thu, Aug 09, 2018 at 08:38:33PM +, Daniel Weller wrote: > Hello, > > I am trying to set an environment variable from inside dnsmasq- giving > the script being called by dhcp-script access to that variable. I > think the location to do this is inside helper.c in the create_helper() > function. However, when it forks I am unable to follow the child process > in my debugger. I have tried setting "set follow-fork-mode " & > "set detach-on-fork " 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? What is the original problem? Groeten Geert Stappers -- Leven en laten leven ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
[Dnsmasq-discuss] Set environment variable for dhcp-script
Hello, I am trying to set an environment variable from inside dnsmasq- giving the script being called by dhcp-script access to that variable. I think the location to do this is inside helper.c in the create_helper() function. However, when it forks I am unable to follow the child process in my debugger. I have tried setting "set follow-fork-mode " & "set detach-on-fork " 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? Thank you, Daniel ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss