Configuration parser broken?

I'm in the process of migrating an existing Homenet router (hncp/hnet-full) from an original Chaos Calmer/Designated Driver installation on a Linksys 1200 onto a Linksys 3200. I had to build and patch the original code to get it to work with my ISP, and I'm trying to stick to standard packages this time.

So, before I get pulled into a rabbit hole, rebuilding from source, I thought I'd check for others' experience.

For repeatability and automation reasons, I avoid LUCI for setting up devices. But I'm seeing what looks like odd behaviour when I re-use my existing uci configuration files.

As an example, if I add comment lines to the /etc/config/network file, the router behaviour changes. Thus, with the files below in /etc/config, I cannot associate with the wifi on the router from my mac, but if I undo this change (ie remove the 3 comment lines), then I can.

Am I missing something, or is this a likely bug - so I'll need to isolate the issue more?

diff --git a/new/etc/config/network b/new/etc/config/network
index b25d3a8..82f58ad 100644
--- a/new/etc/config/network
+++ b/new/etc/config/network
@@ -16,6 +16,9 @@ config interface 'inhnet0'
 config interface 'inhnet1'
        option proto 'hnet'
 
+#unclear why, but commenting out this line causes cootesnest1 to fail to associate an ipv6 address ???
+# cootesnest still does allocate an ipv6 address?? Looks like it's just comments near the `list ipaddr` lines ??
+# Even though the ipv4 address does not get associated. Issue with config parser??
 config interface 'mylan'
        option force_link '1'
 #      option type 'bridge'

/etc/config/network


config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'

config interface 'inhnet0'
	option proto 'hnet'
	option mode 'auto'
#	option ip4assign '24'
#	option ip6assign '60'

config interface 'inhnet1'
	option proto 'hnet'

#unclear why, but commenting out this line causes cootesnest1 to fail to associate an ipv6 address ???
# cootesnest still does allocate an ipv6 address?? Looks like it's just comments near the `list ipaddr` lines ??
# Even though the ipv4 address does not get associated. Issue with config parser??
config interface 'mylan'
	option force_link '1'
#	option type 'bridge'
# only puts in one ip address now, so 172.17.1.4 won't go in?
	option proto 'static'
	list ipaddr '192.168.29.1/24'
	list ipaddr '172.17.1.4/16'
	option ifname 'eth0.1'
	option ip6assign '58'

config interface 'e1'
	option proto 'hnet'
	option ifname 'eth0.1'

#config interface 'wan'
config interface 'e0'
	option ifname 'eth1.2'
#	option _orig_ifname 'eth0'
#	option _orig_bridge 'false'
#	option proto 'dhcp'
#	option proto 'pppoe'
#	option username 'install@o2broadband.co.uk'
#	option password 'install'
#	option ipv6 '1'
#
#config interface 'e0ext'
#	option ifname '@e0'
	option proto 'hnet'
	option mode 'external'
#	option _orig_ifname 'pppoe-e0'

# I think that this ought to be essential, but bouncing the box keeps the link. Unsure that it would work with a longer outage
# need to strip this out somehow, I think for robust longer term model. stable version put it into /lib/netifd/proto/dhcp.sh.
# But that stopped working. Changed s/w identifier to ER115 compared to baseline
config interface 'dummy'
        option proto 'dhcp'
        option ifname 'eth1.2'
       # option vendorid '2.89.1088.R|002|SR102|A512163A016088'
        option vendorid '2.07.2356.R|003|ER115|B222188B007404'
        option clientid '39303231303639336362353840736b7964736c7c3336616134366662'

# this breaks stuff? is it the eth1.1?
#config interface 'lan'
#        option proto 'static'
#        option ifname 'eth1.1'
#	option ipaddr '172.17.1.3'
#        option netmask '255.255.0.0'


config interface 'modemnet'
	option proto 'static'
	option ifname 'eth1.2'
	option ipaddr '192.168.2.63'
	option netmask '255.255.255.0'

/etc/config/wireless


config wifi-device 'radio0'
	option type 'mac80211'
	option channel '36'
	option hwmode '11a'
	option path 'soc/soc:pcie/pci0000:00/0000:00:01.0/0000:01:00.0'
	option htmode 'VHT80'
	option txpower '20'
	option country 'GB'
#	option disabled '1'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'inhnet0'
	option mode 'ap'
	option ssid 'cootesnest'
	option encryption 'none'

config wifi-device 'radio1'
	option type 'mac80211'
	option channel '11'
	option hwmode '11g'
	option path 'soc/soc:pcie/pci0000:00/0000:00:02.0/0000:02:00.0'
	option htmode 'HT20'
#        option disabled '1'
	option txpower '20'
	option country 'GB'

/etc/config/dhcp


config dnsmasq
	option domainneeded '1'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option expandhosts '1'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option noresolv '1'
	option domain 'coote.org'
#	list server '172.17.31.77'
	list server '2001:4860:4860::8888'
        list server '8.8.8.8'
	option localservice '0'
	option boguspriv '0'
#
#	option dhcp-host '88:07:4b:af:0a:c8,set:tims5Y'
#	option dhcp-ignore '!known'

#config dhcp 'lan'
config dhcp 'inhnet1'
	option interface 'lan'
	option dhcpv6 'server'
	option dhcpv4 'server'
	option ra 'server'
	option ra_management '1'
	option start '100'
	option limit '150'
#	option ignore '1'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

config odhcpd 'odhcpd'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option maindhcp '1'
	option loglevel '6'

config host

config dhcp 'modemnet'
	option interface 'modemnet'
	option ignore '1'

Also present, but omitted for brevity: /etc/config/{firewall,system}

The system uses an API to handle UCI configurations, so you should do the same to debug the problem:
https://openwrt.org/docs/guide-user/base-system/uci#command_line_utility