diff options
author | Dave Reisner <d@falconindy.com> | 2011-06-19 10:10:45 -0400 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2011-06-19 10:10:45 -0400 |
commit | 824567cb23ed0bab4ed4568be139ee0c75d7598d (patch) | |
tree | 55a57ef5a1da578f9c81dcd7a9dbac8e9b6065b2 | |
parent | fe48fab2c2c35ccbfa3eec436d40739bc4b486da (diff) |
network: don't enforce check for netmask or gateway
4cad51425325 removed the necessity for defining gateway, but we still
continued to check for it. Remove this check, as well as the check for
netmask. When not supplied, netmask will default to /24.
Signed-off-by: Dave Reisner <d@falconindy.com>
-rwxr-xr-x | network | 8 | ||||
-rw-r--r-- | rc.conf | 2 |
2 files changed, 2 insertions, 8 deletions
@@ -26,13 +26,7 @@ network_up() { ip link set dev $interface up || return 1 if [[ $address ]]; then - for var in netmask gateway; do - if [[ -z ${!var} ]]; then - printf "${C_FAIL}Error: static address defined without $var!\n" - return 1 - fi - done - ip addr add $address/$netmask broadcast ${broadcast:-+} dev $interface || return 1 + ip addr add $address/${netmask:-24} broadcast ${broadcast:-+} dev $interface || return 1 [[ $gateway ]] && { ip route add default via $gateway || return 1; } else dhcpcd $DHCPCD_ARGS $interface || return 1 @@ -64,7 +64,7 @@ HOSTNAME="myhost" # Wired network setup # - interface: name of device (required) # - address: IP address (leave blank for DHCP) -# - netmask: subnet mask (ignored for DHCP) +# - netmask: subnet mask (ignored for DHCP) (optional, defaults to 255.255.255.0) # - broadcast: broadcast address (ignored for DHCP) (optional) # - gateway: default route (ignored for DHCP) # |