avahi: udhcpc default.script: only bring up avahi-autoipd on nak/timeout
authorPeter Korsgaard <jacmet@sunsite.dk>
Thu, 4 Jun 2009 12:55:58 +0000 (14:55 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Thu, 4 Jun 2009 12:58:57 +0000 (14:58 +0200)
The avahi udhcpc script used to start up avahi-autoipd at defconfig
(init) time, and then kill it if a dhcp lease was acquired, leading
to extra network traffic.

Change it to only start avahi-autoipd on timeout and dhcp nak.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/avahi/busybox-udhcpc-default.script

index cc89feba723c2bad647b1f2bda503d39243cdae9..0bb3dea03c78fe9b51e7c37fcf8381ac91ae4c6c 100755 (executable)
@@ -18,6 +18,12 @@ case "$1" in
                if [ $? -eq 0 ]; then
                        /sbin/ifconfig $interface 0.0.0.0
                fi
+               if [ -x /usr/sbin/avahi-autoipd ]; then
+                       /usr/sbin/avahi-autoipd -k $interface
+               fi
+               ;;
+
+       leasefail|nak)
                if [ -x /usr/sbin/avahi-autoipd ]; then
                        /usr/sbin/avahi-autoipd -wD $interface --no-chroot
                fi