aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2011-05-18 12:47:06 -0400
committerPetr Lautrbach <plautrba@redhat.com>2011-08-15 10:21:46 +0200
commit9dec8afc7fab4d52b6031491506af043d32abfb1 (patch)
tree1deaa7c62a980445ad8efc4a6bcab398bbf5f2e4
parent26da54e38428c7edec4da17cd39e22989803b41f (diff)
downloadinitscripts-9dec8afc7fab4d52b6031491506af043d32abfb1.tar
initscripts-9dec8afc7fab4d52b6031491506af043d32abfb1.tar.gz
initscripts-9dec8afc7fab4d52b6031491506af043d32abfb1.tar.bz2
initscripts-9dec8afc7fab4d52b6031491506af043d32abfb1.tar.xz
initscripts-9dec8afc7fab4d52b6031491506af043d32abfb1.zip
Override NETMASK from PREFIX where specified (#705367, <mpoole@redhat.com>)
-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 91181a16..c84bb08d 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -162,6 +162,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=}