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:	Mon, 16 Dec 2013 21:41:41 +0900
From:	Atzm Watanabe <atzm@...atosphere.co.jp>
To:	Daniel Borkmann <dborkman@...hat.com>
Cc:	netdev@...r.kernel.org,
	Stephen Hemminger <stephen@...workplumber.org>,
	Ben Hutchings <bhutchings@...arflare.com>,
	David Miller <davem@...emloft.net>,
	David Laight <David.Laight@...LAB.COM>
Subject: Re: [PATCH v3 3/3] packet: Deliver VLAN TPID to userspace

At Mon, 16 Dec 2013 11:18:09 +0100,
Daniel Borkmann wrote:
> 
> On 12/16/2013 09:12 AM, Atzm Watanabe wrote:
> > This enables userspace to get VLAN TPID as well as the VLAN TCI.
> >
> > Signed-off-by: Atzm Watanabe <atzm@...atosphere.co.jp>
> 
> Looks good, one comment below though:

Thank you for comments.


> >   	__u32	tp_rxhash;
> >   	__u32	tp_vlan_tci;
> > +	__u32	tp_vlan_tpid;
> 
> Why is this not __u16? If this needs to be __u32 aligned, then
> probably we should pad with another __u16. I think we should not
> waste any space here in case there are future additions of new
> members.

Ah, indeed.  I think it does not need to be __u32 aligned too.
I'll fix it next time.


> > diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
> > index 5c75a1d..58d4fd7 100644
> > --- a/net/packet/af_packet.c
> > +++ b/net/packet/af_packet.c
> > @@ -977,9 +977,11 @@ static void prb_fill_vlan_info(struct tpacket_kbdq_core *pkc,
> >   {
> >   	if (vlan_tx_tag_present(pkc->skb)) {
> >   		ppd->hv1.tp_vlan_tci = vlan_tx_tag_get(pkc->skb);
> > -		ppd->tp_status = TP_STATUS_VLAN_VALID;
> > +		ppd->hv1.tp_vlan_tpid = (__force __u32)ntohs(pkc->skb->vlan_proto);
> 
> Nit:                                             ^^^^ one space here, resp. with __u16
>                                                        you won't need the cast.

Yes, will remove the cast next time.


Thank you again!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ