+
+#if IFNET_ROUTE_REFCNT
+ /*
+ * Always discard the cached route for unconnected socket
+ * or if it is a multicast route.
+ */
+ if (in6p->in6p_route.ro_rt != NULL &&
+ ((in6p->in6p_route.ro_rt->rt_flags & RTF_MULTICAST) ||
+ in6p->in6p_socket == NULL ||
+ in6p->in6p_socket->so_state != SS_ISCONNECTED)) {
+ rtfree(in6p->in6p_route.ro_rt);
+ in6p->in6p_route.ro_rt = NULL;
+ }
+#endif /* IFNET_ROUTE_REFCNT */
+