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]
Message-ID: <4B439299.1090205@gmail.com>
Date:	Tue, 05 Jan 2010 20:27:21 +0100
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	"Michael S. Tsirkin" <mst@...hat.com>
CC:	"David S. Miller" <davem@...emloft.net>,
	Neil Horman <nhorman@...driver.com>,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH] net: packet: option to only pass skb protocol

Le 05/01/2010 19:57, Michael S. Tsirkin a écrit :
> When sending packets with a packet socket it is often necessary to set
> protocol in msg_name: otherwise the protocol field in the skb will not
> be set correctly.  However, currently doing this also requires
> supplying the interface index.
> 
> The following patch makes it possible to avoid supplying the interface
> index by interpreting index 0 as "use device this socket is bound to".
> 

Patch is correct, but I dont understand why zero initialization by caller
is any better then supplying ifindex (known when socket was bound to device ?)

To avoid one syscall at socket setup (to get ifindex from dev name),
you prefer to add a test/branch at each send() syscall...

Am I missing something ?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ