]> git.proxmox.com Git - mirror_frr.git/blobdiff - babeld/babel_filter.c
Merge pull request #5793 from ton31337/fix/formatting_show_bgp_summary_failed
[mirror_frr.git] / babeld / babel_filter.c
index ff5cca42a0a89c688054db4253a3e1454d9d3a37..28ba8e16a23793d77527c68c99b5741df2ef75b4 100644 (file)
@@ -20,6 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "babel_filter.h"
 #include "vty.h"
 #include "filter.h"
@@ -35,10 +39,11 @@ babel_filter(int output, const unsigned char *prefix, unsigned short plen,
     struct interface *ifp = if_lookup_by_index(ifindex, VRF_DEFAULT);
     babel_interface_nfo *babel_ifp = ifp ? babel_get_if_nfo(ifp) : NULL;
     struct prefix p;
-    struct distribute *dist;
+    struct distribute *dist = NULL;
     struct access_list *alist;
     struct prefix_list *plist;
     int distribute;
+    struct babel *babel;
 
     p.family = v4mapped(prefix) ? AF_INET : AF_INET6;
     p.prefixlen = v4mapped(prefix) ? plen - 96 : plen;
@@ -77,7 +82,9 @@ babel_filter(int output, const unsigned char *prefix, unsigned short plen,
     }
 
     /* All interface filter check. */
-    dist = distribute_lookup (NULL);
+    babel = babel_lookup();
+    if (babel)
+        dist = distribute_lookup (babel->distribute_ctx, NULL);
     if (dist) {
         if (dist->list[distribute]) {
             alist = access_list_lookup (p.family, dist->list[distribute]);