diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index cba9e6a926ff..e3da758fc72d 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -332,6 +332,12 @@ again: __func__, mtu, rte, (rte != NULL) ? rte->rt_flags : 0, ifp)); if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { m->m_flags |= M_MCAST; + /* + * IP destination address is multicast. Make sure "gw" + * still points to the address in "ro". (It may have been + * changed to point to a gateway address, above.) + */ + gw = dst; /* * See if the caller provided any multicast options */