@Seeking-Sense said in Problem with update pfBlockerNG-devel 3.2.0_18 to 3.2.0_20:
if (is_array($dhcp['staticmap'])) {
Ok, thanks.
Still, for my own curiosity, I still cant see why it failed.
The line above states :
// Collect static DHCP hostnames/IPs
foreach (config_get_path('dhcpd', []) as $dhcp) {
if (is_array($dhcp['staticmap'])) {
The foreach asks for the list of array() in <dhcpd>
It should return a list with <staticmap> </staticmap>, as these are your static lease entries.
So, no need to test inside the foreach loop if arrays exist, as if there were none, the inner loop couldn't be reached in the first place.
My question : do you have an invalid entry somewhere inside the <dhcpd> .. </dhcpd> section ?
This is what I have ( I removed some info ) :
<dhcpd>
<lan>
<range>
<from>192.168.1.70</from>
<to>192.168.1.200</to>
</range>
<defaultleasetime>21600</defaultleasetime>
..... babla
<numberoptions></numberoptions>
<staticmap>
<mac>00:4e:01:ac:ca:9c</mac>
<cid>bureau2</cid>
<ipaddr>192.168.1.2</ipaddr>
<hostname>bureau2</hostname>
.... more blabla
<uefihttpboot></uefihttpboot>
<numberoptions></numberoptions>
</staticmap>
<staticmap>
<mac>ac:15:a2:02:d0:0b</mac>
<cid>TL-SG108E</cid>
<ipaddr>192.168.1.3</ipaddr>
<hostname>TL-SG108E</hostname>
.... bla goes on
<nextserver></nextserver>
<filename32></filename32>
<filename64></filename64>
<filename32arm></filename32arm>
<filename64arm></filename64arm>
<uefihttpboot></uefihttpboot>
<numberoptions></numberoptions>
</staticmap>
<mac_allow></mac_allow>
<mac_deny></mac_deny>
<nextserver></nextserver>
<ddnsdomainprimary></ddnsdomainprimary>
<ddnsdomainkeyname></ddnsdomainkeyname>
.. more dhcp general setting
<ddnsdomainsecondaryport></ddnsdomainsecondaryport>
<dnsregpolicy>default</dnsregpolicy>
<earlydnsregpolicy>default</earlydnsregpolicy>
<ntpserver>192.168.1.1</ntpserver>
</lan>
<opt1>
.... and here we go again, for the second interface (if it exists)
.....
</opt1>
<dhcpd>
Btw : I now also see that the original issue, some error in the dhcpd IPv4 list of static leases was not the same as I had.
My errors came from the <dhcpdv6> section, which comes just after line 5347.
The array list with static lease info was correct, but the indic=vidual IPv6 address were plain wrong, like "::c6" instead of a complete, real IPv6 : example
<staticmap>
<duid>00:01:00:01:1e:6a:44:de:64:00:6a:8b:f1:b3</duid>
<ipaddrv6>::c9</ipaddrv6>
<hostname>bureau</hostname>
<descr><![CDATA[Bureau]]></descr>
<filename></filename>
<rootpath></rootpath>
</staticmap>