Date: Tue, 28 Feb 2017 09:50:34 +0000 (UTC) From: Sepherosa Ziehau <sephe@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314382 - head/sys/dev/hyperv/netvsc Message-ID: <201702280950.v1S9oYr7070925@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sephe Date: Tue Feb 28 09:50:34 2017 New Revision: 314382 URL: https://svnweb.freebsd.org/changeset/base/314382 Log: hyperv/hn: Simplify RNDIS packet data offset calculation. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9699 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Tue Feb 28 06:46:41 2017 (r314381) +++ head/sys/dev/hyperv/netvsc/if_hn.c Tue Feb 28 09:50:34 2017 (r314382) @@ -1784,9 +1784,6 @@ hn_rndis_pktinfo_append(struct rndis_pac pi->rm_type = pi_type; pi->rm_pktinfooffset = RNDIS_PKTINFO_OFFSET; - /* Data immediately follow per-packet-info. */ - pkt->rm_dataoffset += pi_size; - /* Update RNDIS packet msg length */ pkt->rm_len += pi_size; @@ -1932,7 +1929,7 @@ hn_encap(struct ifnet *ifp, struct hn_tx pkt->rm_type = REMOTE_NDIS_PACKET_MSG; pkt->rm_len = sizeof(*pkt) + m_head->m_pkthdr.len; - pkt->rm_dataoffset = sizeof(*pkt); + pkt->rm_dataoffset = 0; pkt->rm_datalen = m_head->m_pkthdr.len; pkt->rm_oobdataoffset = 0; pkt->rm_oobdatalen = 0; @@ -2003,7 +2000,7 @@ hn_encap(struct ifnet *ifp, struct hn_tx pkt_hlen = pkt->rm_pktinfooffset + pkt->rm_pktinfolen; /* Convert RNDIS packet message offsets */ - pkt->rm_dataoffset = hn_rndis_pktmsg_offset(pkt->rm_dataoffset); + pkt->rm_dataoffset = hn_rndis_pktmsg_offset(pkt_hlen); pkt->rm_pktinfooffset = hn_rndis_pktmsg_offset(pkt->rm_pktinfooffset); /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702280950.v1S9oYr7070925>