aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/network-functions
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2011-05-18 12:47:06 -0400
committerBill Nottingham <notting@redhat.com>2011-05-18 12:47:06 -0400
commit1019b73ba59dd0b842550eb79aef7c4ae8d1dce2 (patch)
tree264c5dee04a060f945893462e2af88a968b6553f /sysconfig/network-scripts/network-functions
parentf39db247a18f5c3ac465130b1ac7cd13f1294693 (diff)
downloadinitscripts-1019b73ba59dd0b842550eb79aef7c4ae8d1dce2.tar
initscripts-1019b73ba59dd0b842550eb79aef7c4ae8d1dce2.tar.gz
initscripts-1019b73ba59dd0b842550eb79aef7c4ae8d1dce2.tar.bz2
initscripts-1019b73ba59dd0b842550eb79aef7c4ae8d1dce2.tar.xz
initscripts-1019b73ba59dd0b842550eb79aef7c4ae8d1dce2.zip
Override NETMASK from PREFIX where specified (#705367, <mpoole@redhat.com>)
Diffstat (limited to 'sysconfig/network-scripts/network-functions')
-rw-r--r--sysconfig/network-scripts/network-functions5
1 files changed, 5 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 6224f0c9..5815eaa9 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -168,6 +168,11 @@ expand_config ()
netmask[$i]=$(eval echo '$'NETMASK$idx)
broadcast[$i]=$(eval echo '$'BROADCAST$idx)
+ if [ "${prefix[$i]}x" != "x" ]; then
+ val=$(/bin/ipcalc --netmask "${ipaddr[$i]}/${prefix[$i]}")
+ netmask[$i]=${val##NETMASK=}
+ fi
+
if [ "${netmask[$i]}x" = "x" ]; then
val=$(/bin/ipcalc --netmask "${ipaddr[$i]}")
netmask[$i]=${val##NETMASK=}