From 2aa349f769aada98c9c258da879bc732ec7d823d Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Fri, 12 Aug 2011 00:04:57 -0700 Subject: [PATCH] bug 11083: Fix broadcast address is 0.0.0.0 The reason is: 1. In redundant router, we won't enable eth2(public network interface) until keepalived determine the router is MASTER. 2. ipassoc.sh normally kick in before keepalived process running. And it would set eth2's IP address using "ip addr add $dev $ip" 3. "ip addr add $dev $ip" won't add mask for the device, then there is no way to update broadcast address for eth2. Then broadcast address is 0.0.0.0. 4. As long as "ip addr add $dev $ip" executed, later executed "ifconfig $dev $ip netmask $mask" won't calculated the broadcast address from $ip and $mask. To fix this, we enable and configure eth2 temporaily when cloud-early-config executed, then disable eth2 interface. By this way, broadcast address of should be calculated and set correctly. status 11083: resolved fixed --- patches/systemvm/debian/config/etc/init.d/cloud-early-config | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/patches/systemvm/debian/config/etc/init.d/cloud-early-config b/patches/systemvm/debian/config/etc/init.d/cloud-early-config index 508fb146cc6..5236391acdc 100755 --- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config +++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config @@ -162,9 +162,10 @@ setup_interface() { fi ifdown $intf - if [ "$RROUTER" != "1" -o "$1" != "2" ] + ifup $intf + if [ "$RROUTER" == "1" -a "$1" == "2" ] then - ifup $intf + ifdown $intf fi }