diff options
author | 2017-05-17 13:25:27 +0000 | |
---|---|---|
committer | 2017-05-17 13:25:27 +0000 | |
commit | 5198286ee93935b72020027c8efebbd6fe7bee7f (patch) | |
tree | 574134a94351f7864836766e8c0f9fbc786c785d | |
parent | Tweak remote fs check. (diff) | |
download | wireguard-openbsd-5198286ee93935b72020027c8efebbd6fe7bee7f.tar.xz wireguard-openbsd-5198286ee93935b72020027c8efebbd6fe7bee7f.zip |
Optimize multicast packet sending by using m_dup_pkt() instead of
m_copym() for cloning packets. m_dup_pkt() creates a new mbuf with the
whole packet content and also pre allocates the space for layer 2
headers (Ethernet/VLAN).
ok mikeb@
-rw-r--r-- | sys/netinet6/ip6_mroute.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 20638b2fd1c..73833850790 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -1108,10 +1108,7 @@ phyint_send6(struct ifnet *ifp, struct ip6_hdr *ip6, struct mbuf *m) * the IPv6 header is actually copied, not just referenced, * so that ip6_output() only scribbles on the copy. */ - mb_copy = m_copym(m, 0, M_COPYALL, M_NOWAIT); - if (mb_copy && - (M_READONLY(mb_copy) || mb_copy->m_len < sizeof(struct ip6_hdr))) - mb_copy = m_pullup(mb_copy, sizeof(struct ip6_hdr)); + mb_copy = m_dup_pkt(m, max_linkhdr, M_NOWAIT); if (mb_copy == NULL) return; /* set MCAST flag to the outgoing packet */ |