Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137036319
D7502.id19275.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D7502.id19275.diff
View Options
Index: sys/dev/hyperv/netvsc/hv_net_vsc.c
===================================================================
--- sys/dev/hyperv/netvsc/hv_net_vsc.c
+++ sys/dev/hyperv/netvsc/hv_net_vsc.c
@@ -847,19 +847,18 @@
struct vmbus_channel *chan, const struct vmbus_chanpkt_hdr *pkthdr)
{
const struct vmbus_chanpkt_rxbuf *pkt;
- const nvsp_msg *nvsp_msg_pkt;
+ const struct hn_nvs_hdr *nvs_hdr;
netvsc_packet vsc_pkt;
netvsc_packet *net_vsc_pkt = &vsc_pkt;
int count = 0;
int i = 0;
int status = nvsp_status_success;
- nvsp_msg_pkt = VMBUS_CHANPKT_CONST_DATA(pkthdr);
-
- /* Make sure this is a valid nvsp packet */
- if (nvsp_msg_pkt->hdr.msg_type != nvsp_msg_1_type_send_rndis_pkt) {
- if_printf(rxr->hn_ifp, "packet hdr type %u is invalid!\n",
- nvsp_msg_pkt->hdr.msg_type);
+ /* Make sure that this is a RNDIS message. */
+ nvs_hdr = VMBUS_CHANPKT_CONST_DATA(pkthdr);
+ if (__predict_false(nvs_hdr->nvs_type != HN_NVS_TYPE_RNDIS)) {
+ if_printf(rxr->hn_ifp, "nvs type %u, not RNDIS\n",
+ nvs_hdr->nvs_type);
return;
}
Index: sys/dev/hyperv/netvsc/if_hnreg.h
===================================================================
--- sys/dev/hyperv/netvsc/if_hnreg.h
+++ sys/dev/hyperv/netvsc/if_hnreg.h
@@ -69,6 +69,11 @@
*/
#define HN_NVS_REQSIZE_MIN 32
+/* NVS message common header */
+struct hn_nvs_hdr {
+ uint32_t nvs_type;
+} __packed;
+
struct hn_nvs_init {
uint32_t nvs_type; /* HN_NVS_TYPE_INIT */
uint32_t nvs_ver_min;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 22, 12:51 AM (2 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25849631
Default Alt Text
D7502.id19275.diff (1 KB)
Attached To
Mode
D7502: hyperv/hn: Simplify RNDIS message checks on RX path.
Attached
Detach File
Event Timeline
Log In to Comment