diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index a07036e..b4ea242 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -1124,8 +1124,16 @@
 {
   int ret = 0;
   struct nexthop *nexthop, *tnexthop;
+  rib_table_info_t *info = rn->table->info;
   int recursing;
 
+  if (info->safi != SAFI_UNICAST)
+    {
+      for (ALL_NEXTHOPS_RO(rib->nexthop, nexthop, tnexthop, recursing))
+        SET_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB);
+      return;
+    }
+
   /*
    * Make sure we update the FPM any time we send new information to
    * the kernel.
@@ -1157,8 +1165,16 @@
 {
   int ret = 0;
   struct nexthop *nexthop, *tnexthop;
+  rib_table_info_t *info = rn->table->info;
   int recursing;
 
+  if (info->safi != SAFI_UNICAST)
+    {
+      for (ALL_NEXTHOPS_RO(rib->nexthop, nexthop, tnexthop, recursing))
+        SET_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB);
+      return ret;
+    }
+
   /*
    * Make sure we update the FPM any time we send new information to
    * the kernel.
@@ -1187,9 +1203,12 @@
 static void
 rib_uninstall (struct route_node *rn, struct rib *rib)
 {
+  rib_table_info_t *info = rn->table->info;
+
   if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED))
     {
-      zfpm_trigger_update (rn, "rib_uninstall");
+      if (info->safi == SAFI_UNICAST)
+        zfpm_trigger_update (rn, "rib_uninstall");
 
       redistribute_delete (&rn->p, rib);
       if (! RIB_SYSTEM_ROUTE (rib))
@@ -1306,9 +1325,6 @@
       if (! nexthop_active_update (rn, rib, 0))
         continue;
 
-      if (info->safi == SAFI_MULTICAST)
-	continue;
-
       /* Infinit distance. */
       if (rib->distance == DISTANCE_INFINITY)
         continue;
@@ -1371,7 +1387,8 @@
 		     select, fib);
       if (CHECK_FLAG (select->flags, ZEBRA_FLAG_CHANGED))
         {
-	  zfpm_trigger_update (rn, "updating existing route");
+          if (info->safi == SAFI_UNICAST)
+	    zfpm_trigger_update (rn, "updating existing route");
 
           redistribute_delete (&rn->p, select);
           if (! RIB_SYSTEM_ROUTE (select))
@@ -1414,7 +1431,8 @@
       if (IS_ZEBRA_DEBUG_RIB)
 	rnode_debug (rn, "Removing existing route, fib %p", fib);
 
-      zfpm_trigger_update (rn, "removing existing route");
+      if (info->safi == SAFI_UNICAST)
+        zfpm_trigger_update (rn, "removing existing route");
 
       redistribute_delete (&rn->p, fib);
       if (! RIB_SYSTEM_ROUTE (fib))
@@ -1434,7 +1452,8 @@
       if (IS_ZEBRA_DEBUG_RIB)
 	rnode_debug (rn, "Adding route, select %p", select);
 
-      zfpm_trigger_update (rn, "new route selected");
+      if (info->safi == SAFI_UNICAST)
+        zfpm_trigger_update (rn, "new route selected");
 
       /* Set real nexthop. */
       nexthop_active_update (rn, select, 1);
@@ -3267,6 +3286,7 @@
 rib_close_table (struct route_table *table)
 {
   struct route_node *rn;
+  rib_table_info_t *info = table->info;
   struct rib *rib;
 
   if (table)
@@ -3276,7 +3296,8 @@
           if (!CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED))
 	    continue;
 
-	  zfpm_trigger_update (rn, NULL);
+          if (info->safi == SAFI_UNICAST)
+            zfpm_trigger_update (rn, NULL);
 
 	  if (! RIB_SYSTEM_ROUTE (rib))
 	    rib_uninstall_kernel (rn, rib);
