dhcp-client: don't assume we got option 1 (subnet)

If we don't get subnet, then just set the IP address.

Issue #278

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2024-01-30 15:32:38 +01:00
committed by Tobias Waldekranz
parent 08cec2e9bc
commit faa6ce849b
@@ -105,7 +105,13 @@ case "$ACTION" in
/usr/sbin/avahi-autoipd -c $interface && /usr/sbin/avahi-autoipd -k $interface
fi
if /bin/ip addr add dev $interface $ip/$NETMASK $BROADCAST proto 5; then
if [ -n "$NETMASK" ]; then
IP=$ip/$NETMASK
else
IP=$ip
fi
if /bin/ip addr add dev $interface $IP $BROADCAST proto 5; then
echo "$ip" > "$IP_CACHE"
fi
if [ -n "$ipv6" ] ; then