summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authordcs <dcs@FreeBSD.org>2001-07-17 18:47:48 +0000
committerdcs <dcs@FreeBSD.org>2001-07-17 18:47:48 +0000
commit4e8adbcead497dffc17690600646e9a9a593e298 (patch)
tree7a1b688e57fd40df86ce0d379df31ed806c6af9b /sys/netinet
parent9fa0021c9a6e8663a7371da27e633c57df02901d (diff)
downloadFreeBSD-src-4e8adbcead497dffc17690600646e9a9a593e298.zip
FreeBSD-src-4e8adbcead497dffc17690600646e9a9a593e298.tar.gz
Skip the route checking in the case of multicast packets with known
interfaces. Reviewed by: people at that channel Approved by: silence on -net
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_output.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 10de694..c8b3bfa 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -252,15 +252,26 @@ ip_output(m0, opt, ro, flags, imo)
ifp = ia->ia_ifp;
ip->ip_ttl = 1;
isbroadcast = in_broadcast(dst->sin_addr, ifp);
+ } else if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) &&
+ (imo != NULL) &&
+ (imo->imo_multicast_ifp != NULL)) {
+ /*
+ * bypass the normal routing lookup for
+ * multicast packets if the interface is
+ * specified
+ */
+ /* No Operation */
} else {
/*
- * If this is the case, we probably don't want to allocate
- * a protocol-cloned route since we didn't get one from the
- * ULP. This lets TCP do its thing, while not burdening
- * forwarding or ICMP with the overhead of cloning a route.
- * Of course, we still want to do any cloning requested by
- * the link layer, as this is probably required in all cases
- * for correct operation (as it is for ARP).
+ * If this is the case, we probably don't want
+ * to allocate a protocol-cloned route since we
+ * didn't get one from the ULP. This lets TCP
+ * do its thing, while not burdening forwarding
+ * or ICMP with the overhead of cloning a route.
+ * Of course, we still want to do any cloning
+ * requested by the link layer, as this is
+ * probably required in all cases for correct
+ * operation (as it is for ARP).
*/
if (ro->ro_rt == 0)
rtalloc_ign(ro, RTF_PRCLONING);
@@ -273,9 +284,11 @@ ip_output(m0, opt, ro, flags, imo)
ifp = ro->ro_rt->rt_ifp;
ro->ro_rt->rt_use++;
if (ro->ro_rt->rt_flags & RTF_GATEWAY)
- dst = (struct sockaddr_in *)ro->ro_rt->rt_gateway;
+ dst = (struct sockaddr_in *)
+ ro->ro_rt->rt_gateway;
if (ro->ro_rt->rt_flags & RTF_HOST)
- isbroadcast = (ro->ro_rt->rt_flags & RTF_BROADCAST);
+ isbroadcast = (ro->ro_rt->rt_flags &
+ RTF_BROADCAST);
else
isbroadcast = in_broadcast(dst->sin_addr, ifp);
}
OpenPOWER on IntegriCloud