At boot time, I always see this messages: * Running dhcpcd ... dhcpcd[262]: version 5.5.6 starting dhcpcd[262]: Kernel is not configured to accept IPv6 RAs dhcpcd[262]: em0: broadcasting for a lease dhcpcd[262]: em0: offered 192.168.122.136 from 192.168.122.1 dhcpcd[262]: em0: acknowledged 192.168.122.136 from 192.168.122.1 dhcpcd[262]: em0: checking for 192.168.122.136 dhcpcd[262]: em0: leased 192.168.122.136 for 3600 seconds dhcpcd[262]: forked to background, child pid 298 [ ok ] [: 0xff: bad number [: 0xff: bad number [: 0xff: bad number [: 0xff: bad number * received address 192.168.122.136/ Network connection works well. But here is definitely a portability issue. Please tell me where I can find more information. I am unsure, maybe I should write to Roy Marples trac? Reproducible: Always
(In reply to comment #0) > [: 0xff: bad number > [: 0xff: bad number > [: 0xff: bad number > [: 0xff: bad number > * received address 192.168.122.136/ > > Network connection works well. But here is definitely a portability issue. > Please tell me where I can find more information. > > I am unsure, maybe I should write to Roy Marples trac? It's openrc script bug. Netmask must be decimal number. However, FreeBSD returns hexadecimal number. Fails to numerical comparison in conditional branching, you have found a message is displayed. I'll attach a sample patch. NOTE, Please don't forget to etc-update ! FYI, ifconfig results on Linux) netmask 255.255.255.0 on FreeBSD) netmask 0xffffff00
Created attachment 341008 [details, diff] sample patch for openrc-0.11.8
(In reply to comment #1) > (In reply to comment #0) > > [: 0xff: bad number > > [: 0xff: bad number > > [: 0xff: bad number > > [: 0xff: bad number > > * received address 192.168.122.136/ > > > > Network connection works well. But here is definitely a portability issue. > > Please tell me where I can find more information. > > > > I am unsure, maybe I should write to Roy Marples trac? > > It's openrc script bug. > > Netmask must be decimal number. > However, FreeBSD returns hexadecimal number. Where is the hex number coming from? I can apply the patch to OpenRC, but I would like to know where the hex number is from; that might need to be fixed to give us the expected return value.
(In reply to comment #3) > Where is the hex number coming from? I can apply the patch to OpenRC, but I > would like to know where the hex number is from; that might need to be fixed > to give us the expected return value. The output of "ifconfig em0" is this: em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC> ether 52:54:00:fb:f7:a7 inet6 fe80::5054:ff:fefb:f7a7%em0 prefixlen 64 scopeid 0x2 inet 192.168.0.6 netmask 0xffffff00 broadcast 192.168.0.255 <snip> and from /lib/rc/net/ifconfig.sh: _get_inet_address() { local inet= address= n= netmask= rest= LC_ALL=C ifconfig "${IFACE}" | while read inet address n netmask rest; do if [ "${inet}" = "inet" ]; then echo "${address}/$(_netmask2cidr "${netmask}")" return 0 ... It calls "_netmask2cidr 0xffffff00" /etc/init.d/net.lo's _netmask2cidr() convert "0xffffff00" to "0xff.0xff.0xff.0x00" and passed to the patch lines.
This is applied in commit f1ae896 and will be part of openrc-0.12. Thanks for the report.