On 2015/09/13 13:19, Stuart Henderson wrote:
> Avoid printing "IPv6 autoconf:" if you have no v6 rtsol interfaces.
> OK?

As suggested by rpe, just do the check once in ifautoconf.
(I was trying to avoid the indent, but it's not too horrible)

Index: netstart
===================================================================
RCS file: /cvs/src/etc/netstart,v
retrieving revision 1.154
diff -u -p -r1.154 netstart
--- netstart    11 Sep 2015 12:21:52 -0000      1.154
+++ netstart    13 Sep 2015 12:33:38 -0000
@@ -154,16 +154,18 @@ ifmstart() {
 # IPv6 autoconf the interfaces in the list at $rtsolif
 # Usage: ifautoconf
 ifautoconf() {
-       printf 'IPv6 autoconf:'
-       # $ip6kernel will not have been set if we were invoked with a
-       # list of interface names
-       if ifconfig lo0 inet6 >/dev/null 2>&1; then
-               for curif in $rtsolif; do
-                       printf ' %s' $curif
-                       ifconfig $curif inet6 autoconf
-               done
+       if [[ -n $rtsolif ]]; then
+               printf 'IPv6 autoconf:'
+               # $ip6kernel will not have been set if we were invoked with a
+               # list of interface names
+               if ifconfig lo0 inet6 >/dev/null 2>&1; then
+                       for curif in $rtsolif; do
+                               printf ' %s' $curif
+                               ifconfig $curif inet6 autoconf
+                       done
+               fi
+               echo
        fi
-       echo
 }
 
 # Get network related vars from rc.conf using the parsing routine from rc.subr.

Reply via email to