Vitezslav Samel <vitezslav(a)samel.cz> writes:
On Wed, Nov 28, 2012 at 11:12:50AM +0100, Nikola Pajkovsky wrote:
> Vitezslav Samel <vitezslav(a)samel.cz> writes:
>
> > Since recvfrom() is emulated by recvmsg() (in kernel space), make use
> > of recvmsg().
> >
> > This also prepares the ground for VLAN handling: since about 6 years
> > the VLAN header is stripped off the packet (except for some rare and/or
> > software interfaces) and is passed to us using auxilliary data structure.
> > This 'struct tpacket_auxdata' is passed to us using control messages
> > (see cmsg(3)) and these control messages can be received only by recvmsg(2).
> >
> > Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
> > ---
> > src/packet.c | 19 ++++++++++++++-----
> > 1 files changed, 14 insertions(+), 5 deletions(-)
>
> patch is not bad, but you will have to convince me, that recvfrom is
> emulated by recvmsg ;)
linux-3.6/net/socket.c: lines 1753 - 1792
Hope this will convince you.
nice one,
I overlooked for the first time this part
err = (nosec ? sock_recvmsg_nosec : sock_recvmsg)(sock, msg_sys,
total_len, flags);
--
Nikola