--- zebra-0.94/ripd/rip_interface.c.mcast-leak 2003-11-04 21:00:42 +0300 +++ zebra-0.94/ripd/rip_interface.c 2004-03-31 19:33:29 +0400 @@ -309,8 +309,11 @@ rip_request_neighbor_all () int rip_multicast_join (struct interface *ifp, int sock) { + struct rip_interface *ri; listnode cnode; + ri = ifp->info; + if (if_is_up (ifp) && if_is_multicast (ifp)) { if (IS_RIP_DEBUG_EVENT) @@ -332,7 +335,10 @@ rip_multicast_join (struct interface *if if (ipv4_multicast_join (sock, group, p->prefix, ifp->ifindex) < 0) return -1; else - return 0; + { + ri->joined_multicast = 1; + return 0; + } } } return 0; @@ -342,10 +348,14 @@ rip_multicast_join (struct interface *if void rip_multicast_leave (struct interface *ifp, int sock) { + struct rip_interface *ri; listnode cnode; - if (if_is_up (ifp) && if_is_multicast (ifp)) + ri = ifp->info; + + if (ri->joined_multicast) { + ri->joined_multicast = 0; if (IS_RIP_DEBUG_EVENT) zlog_info ("multicast leave from %s", ifp->name); --- zebra-0.94/ripd/ripd.h.mcast-leak 2003-11-04 21:00:42 +0300 +++ zebra-0.94/ripd/ripd.h 2004-03-31 18:38:58 +0400 @@ -226,6 +226,9 @@ struct rip_interface /* RIP is running on this interface. */ int running; + /* Joined to multicast group for this interface. */ + int joined_multicast; + /* RIP version control. */ int ri_send; int ri_receive;