Re: dhcpcd seg faulting dhcp_handledhcp
Roy Marples
Tue Apr 30 23:41:11 2019
Hi Roger
On 30/04/2019 20:20, Roger Hegstrom wrote:
I'm running linux as a router/firewall for my home and was noticing
dhcpcd was seg faulting like within 6 hours.
enp0s10 is my wan interface, and enp5s12(192.168.1.1) is my lan
interface ..
I added the following lines to dhcp.c in the function dhcp_handledhcp
and it stops the seg faulting but im wondering why its happening.
>>> if (state == NULL) {
>>> logdebugx("%s: dhcp_handledhcp from %s: state->xid
is NULL!!", ifp->name, inet_ntoa(*from) );
>>> return;
>>> }
Already fixed here:
https://roy.marples.name/git/dhcpcd.git/commit/?h=dhcpcd-7&id=bdeeffdc770c53f7799d772d203e48e886b98238
dhcpcd should only be running on my wan interface(enp0s10) so i dont
understand why my lan interface(enp5s12) is getting caught up in this..
Forgive me if i dont know howto explain it any better. If you need any
more information let me know.
It's an optimisation :)
We need the BOOTPC socket open on the unspecified address (or all
interfaces) so that we don't erroneously send back an ICMP unreachable
during the initial phase.
Old dhcpcd just drained the socket from data and discarded it.
New dhcpcd closes the BPF socket it used during the initial phase and
now parses the data from the global socket.
The idea is that once bound, dhcpcd uses less resources.
The error was assuming that if DHCP was received on an interface, dhcpcd
was actively using it.
This patch corrects that.
Hope this helps, and thanks for the patch.
Roy
Archive administrator: postmaster@marples.name