if_detach(): Fix unoptimized compilation without ALTQ in the config.
authorSascha Wildner <saw@online.de>
Thu, 1 Jul 2010 16:51:26 +0000 (18:51 +0200)
committerSascha Wildner <saw@online.de>
Thu, 1 Jul 2010 16:57:36 +0000 (18:57 +0200)
altq_disable() and altq_detach() aren't available until ALTQ is configured
and compilation with -O0 failed linking.

$deity knows why this worked when building optimized (our default).

sys/net/if.c

index 084de48..5a43dac 100644 (file)
@@ -728,10 +728,12 @@ if_detach(struct ifnet *ifp)
 #endif
        if_down(ifp);
 
+#ifdef ALTQ
        if (ifq_is_enabled(&ifp->if_snd))
                altq_disable(&ifp->if_snd);
        if (ifq_is_attached(&ifp->if_snd))
                altq_detach(&ifp->if_snd);
+#endif
 
        /*
         * Clean up all addresses.