]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/irdp_main.c
Merge pull request #263 from opensourcerouting/assorted-20170308
[mirror_frr.git] / zebra / irdp_main.c
index 069a2df006bc1c6fe8b5df26dce02684435dba4c..7fa4ad4cbe8b5716aecc7070405e7d6d5936bfd9 100644 (file)
@@ -45,6 +45,7 @@
 #include "prefix.h"
 #include "command.h"
 #include "memory.h"
+#include "zebra_memory.h"
 #include "stream.h"
 #include "ioctl.h"
 #include "connected.h"
@@ -178,6 +179,7 @@ irdp_send(struct interface *ifp, struct prefix *p, struct stream *s)
 {
   struct zebra_if *zi=ifp->info;
   struct irdp_interface *irdp=&zi->irdp;
+  char buf[PREFIX_STRLEN];
   u_int32_t dst;
   u_int32_t ttl=1;
 
@@ -189,10 +191,9 @@ irdp_send(struct interface *ifp, struct prefix *p, struct stream *s)
     dst = htonl(INADDR_ALLHOSTS_GROUP);
 
   if(irdp->flags & IF_DEBUG_MESSAGES) 
-    zlog_debug("IRDP: TX Advert on %s %s/%d Holdtime=%d Preference=%d", 
+    zlog_debug("IRDP: TX Advert on %s %s Holdtime=%d Preference=%d",
              ifp->name,
-             inet_ntoa(p->u.prefix4), 
-             p->prefixlen,
+             prefix2str(p, buf, sizeof buf),
              irdp->flags & IF_SHUTDOWN? 0 : irdp->Lifetime,
              get_pref(irdp, p));
 
@@ -303,17 +304,16 @@ void process_solicit (struct interface *ifp)
 
 void irdp_finish()
 {
-
+  struct vrf *vrf;
   struct listnode *node, *nnode;
   struct interface *ifp;
   struct zebra_if *zi;
   struct irdp_interface *irdp;
-  vrf_iter_t iter;
 
   zlog_info("IRDP: Received shutdown notification.");
  
-  for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter)) 
-    for (ALL_LIST_ELEMENTS (vrf_iter2iflist (iter), node, nnode, ifp))
+  RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id)
+    for (ALL_LIST_ELEMENTS (vrf->iflist, node, nnode, ifp))
       {
         zi = ifp->info;