diff options
author | Bill Nottingham <notting@redhat.com> | 2011-05-18 12:47:06 -0400 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2011-05-18 12:47:06 -0400 |
commit | 1019b73ba59dd0b842550eb79aef7c4ae8d1dce2 (patch) | |
tree | 264c5dee04a060f945893462e2af88a968b6553f /sysconfig/network-scripts | |
parent | f39db247a18f5c3ac465130b1ac7cd13f1294693 (diff) | |
download | initscripts-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')
-rw-r--r-- | sysconfig/network-scripts/network-functions | 5 |
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=} |