[ospfd] Fix multicast membership drop bug

2006-06-15 Paul Jakma <paul.jakma@sun.com>

	* Reported by Milan Koci
	* ospf_interface.h: (struct ospf_if_info) Add reference counts
	  for multicast group memberships. Add various macros to help
	  manipulate/check membership state.
	* ospf_interface.c: (ospf_if_set_multicast) Maintain the
	  ospf_if_info reference counts, and only actually drop
	  memberships if it hits 0, to avoid losing membership when
	  OSPF is disabled on an interface with multiple active OSPF
	  interfaces.
	* ospf_packet.c: (ospf_{hello,read}) Use the new macros to
	  check/set
	  multicast membership.
	* ospf_vty.c: (show_ip_ospf_interface_sub) ditto.
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 8d6ff31..10580ab 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -2811,12 +2811,15 @@
 	}
 
       vty_out (vty, "  Multicast group memberships:");
-      if (CHECK_FLAG(oi->multicast_memberships, MEMBER_ALLROUTERS))
-        vty_out (vty, " OSPFAllRouters");
-      if (CHECK_FLAG(oi->multicast_memberships, MEMBER_DROUTERS))
-        vty_out (vty, " OSPFDesignatedRouters");
-      if (!CHECK_FLAG(oi->multicast_memberships,
-		      MEMBER_ALLROUTERS|MEMBER_DROUTERS))
+      if (OI_MEMBER_CHECK(oi, MEMBER_ALLROUTERS)
+          || OI_MEMBER_CHECK(oi, MEMBER_DROUTERS))
+        {
+          if (OI_MEMBER_CHECK(oi, MEMBER_ALLROUTERS))
+            vty_out (vty, " OSPFAllRouters");
+          if (OI_MEMBER_CHECK(oi, MEMBER_DROUTERS))
+            vty_out (vty, " OSPFDesignatedRouters");
+        }
+      else
         vty_out (vty, " <None>");
       vty_out (vty, "%s", VTY_NEWLINE);