diff --git a/xCAT-nbroot2/dhclient-script b/xCAT-nbroot2/dhclient-script index 652ae266b..a324647db 100755 --- a/xCAT-nbroot2/dhclient-script +++ b/xCAT-nbroot2/dhclient-script @@ -42,5 +42,9 @@ elif [ $reason = "BOUND6" ]; then if [ ! -z "$new_ip6_address" ]; then ip addr add dev $interface $new_ip6_address/$new_ip6_prefixlen fi +elif [ $reason = "RELEASE" ]; then + if [ ! -z "$old_ip_address" ]; then + ip addr del dev $interface $old_ip_address/$old_subnet_mask + fi fi exit 0 diff --git a/xCAT-nbroot2/dodiscovery b/xCAT-nbroot2/dodiscovery index edbc693ce..537d402e0 100755 --- a/xCAT-nbroot2/dodiscovery +++ b/xCAT-nbroot2/dodiscovery @@ -83,7 +83,7 @@ CPUTYPE=`cat /tmp/cpumod|awk -F':' '{print $2}'|sed -e 's/^ //'` echo '' > /tmp/discopacket echo "findme" >> /tmp/discopacket echo "$ARCH" >> /tmp/discopacket -if [ ! -z "$IAMAVM" ]; then +if [ "$IAMAVM"=1 ]; then echo "virtual" >> /tmp/discopacket fi echo "$CPUCOUNT" >> /tmp/discopacket @@ -99,7 +99,7 @@ for dev in `ip link|grep -B1 ether|grep UP|awk '{print $2}'|sed -e s/://`; do DRIVER=`grep DRIVER /sys/class/net/$dev/device/uevent|awk -F= '{print $2}'` ADDRESS=`ip address show dev $dev|grep "inet "|grep global|awk '{print $2}'` MAC=`ip link show dev $dev|grep ether|awk '{print $2}'` - echo "$DRIVER|$MAC|$ADDRESS" >> /tmp/discopacket + echo "$DRIVER|$dev|$MAC|$ADDRESS" >> /tmp/discopacket done echo "$PUBKEY" >> /tmp/discopacket #this is not secure to use by itself, switch sourced pubkey for security echo "" >> /tmp/discopacket @@ -123,7 +123,7 @@ while [ ! -r /restart ]; do for dhcps in `grep dhcp-server /var/lib/dhclient/dhclient.leases|awk '{print $4}'|sed -s 's/;//'`; do (cat /tmp/discopacket | udpcat.awk $dhcps $XCATPORT ) & done - cat /tmp/discopacket + #cat /tmp/discopacket sleep 5 done /bin/restart