lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 22 Jul 2020 08:19:04 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Sriram Krishnan <srirakr2@...co.com>
Cc:     "K. Y. Srinivasan" <kys@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        Wei Liu <wei.liu@...nel.org>, mbumgard@...co.com,
        ugm@...co.com, nimm@...co.com, xe-linux-external@...co.com,
        "David S. Miller" <davem@...emloft.net>,
        linux-hyperv@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5] hv_netvsc: add support for vlans in AF_PACKET mode

On Wed, 22 Jul 2020 12:38:07 +0530 Sriram Krishnan wrote:
> +	/* When using AF_PACKET we need to drop VLAN header from
> +	 * the frame and update the SKB to allow the HOST OS
> +	 * to transmit the 802.1Q packet
> +	 */
> +	if (skb->protocol == htons(ETH_P_8021Q)) {
> +		u16 vlan_tci = 0;
> +		skb_reset_mac_header(skb);
> +		if (eth_type_vlan(eth_hdr(skb)->h_proto)) {
> +			if (unlikely(__skb_vlan_pop(skb, &vlan_tci) != 0)) {
> +				++net_device_ctx->eth_stats.vlan_error;
> +				goto drop;
> + 			}
> +
> +			__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tci);
> +			/* Update the NDIS header pkt lengths */
> +			packet->total_data_buflen -= VLAN_HLEN;
> +			packet->total_bytes -= VLAN_HLEN;
> +			rndis_msg->msg_len = packet->total_data_buflen;
> +			rndis_msg->msg.pkt.data_len = packet->total_data_buflen;
> +		}
> +	}

Please run checkpatch on your submissions:

WARNING: Missing a blank line after declarations
#76: FILE: drivers/net/hyperv/netvsc_drv.c:614:
+		u16 vlan_tci = 0;
+		skb_reset_mac_header(skb);

ERROR: code indent should use tabs where possible
#81: FILE: drivers/net/hyperv/netvsc_drv.c:619:
+ ^I^I^I}$

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ