diff options
author | Lukas Nykryn <lnykryn@redhat.com> | 2012-10-08 14:53:09 +0200 |
---|---|---|
committer | Lukas Nykryn <lnykryn@redhat.com> | 2012-10-08 14:53:09 +0200 |
commit | 90b20a810f7ea3dec814efa125d9e4c2d3b306cc (patch) | |
tree | 935e1adf857411b6aaf43433b57f89eae946b5c5 | |
parent | 6087204f73fcd2a87b3e08cb86c156ce75f2e405 (diff) | |
download | initscripts-90b20a810f7ea3dec814efa125d9e4c2d3b306cc.tar initscripts-90b20a810f7ea3dec814efa125d9e4c2d3b306cc.tar.gz initscripts-90b20a810f7ea3dec814efa125d9e4c2d3b306cc.tar.bz2 initscripts-90b20a810f7ea3dec814efa125d9e4c2d3b306cc.tar.xz initscripts-90b20a810f7ea3dec814efa125d9e4c2d3b306cc.zip |
check an IP address for existence in ifup-alias (#852005)
-rwxr-xr-x | sysconfig/network-scripts/ifup-aliases | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/ifup-aliases b/sysconfig/network-scripts/ifup-aliases index 15673e47..91071d8b 100755 --- a/sysconfig/network-scripts/ifup-aliases +++ b/sysconfig/network-scripts/ifup-aliases @@ -257,6 +257,12 @@ function new_interface () fi if [ "$setup_this" = "yes" ] ; then + [ "${REALDEVICE}" != "lo" ] && \ + if ! /sbin/arping -q -c 2 -w 3 -D -I ${parent_device} ${$IPADDR} ; then + net_log $"Error, some other host already uses address ${IPADDR}." + return 1 + fi + /sbin/ip addr add ${IPADDR}/${PREFIX} brd ${BROADCAST} dev ${parent_device} label ${DEVICE} if [ "$NO_ALIASROUTING" != yes ]; then |