summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-06-19 10:10:45 -0400
committerDave Reisner <d@falconindy.com>2011-06-19 10:10:45 -0400
commit824567cb23ed0bab4ed4568be139ee0c75d7598d (patch)
tree55a57ef5a1da578f9c81dcd7a9dbac8e9b6065b2
parentfe48fab2c2c35ccbfa3eec436d40739bc4b486da (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-xnetwork8
-rw-r--r--rc.conf2
2 files changed, 2 insertions, 8 deletions
diff --git a/network b/network
index 38ada9a..0177c04 100755
--- a/network
+++ b/network
@@ -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
diff --git a/rc.conf b/rc.conf
index c17c48c..5984171 100644
--- a/rc.conf
+++ b/rc.conf
@@ -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)
#