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:	Tue, 06 Oct 2009 12:06:42 +0200
From:	Oliver Hartkopp <socketcan@...tkopp.net>
To:	Neil Horman <nhorman@...driver.com>,
	Eric Dumazet <eric.dumazet@...il.com>,
	David Miller <davem@...emloft.net>
CC:	netdev@...r.kernel.org
Subject: Re: [PATCH] af_packet: add interframe drop cmsg (v6)


> 
> C) When the application goes to dequeue a frame from the packet socket, we look
> at skb->mark for that frame.  If it is non-zero, we add a cmsg chunk to the
> msghdr of level SOL_PACKET and type PACKET_GAPDATA.  Its a 32 bit integer that
> represents the number of frames lost between this packet and the last previous
> frame received.
> 


> +	gap = check_packet_gap(skb);
> +	if (gap)
> +		put_cmsg(msg, SOL_PACKET, PACKET_GAPDATA, sizeof(__u32), &gap);
> +

I wonder, if using SOL_PACKET with a packet specific sockopt PACKET_GAPDATA is
the right approach here, as this functionality should probably be made
available to all DGRAM/RAW sockets ...

E.g. getting the gap information is also interesting for CAN_RAW sockets as i
polled from the SocketCAN ML.

So i could easily implement something like this in net/can/raw.c :

gap = check_packet_gap(skb);
if (gap)
	put_cmsg(msg, SOL_CAN_RAW, CAN_RAW_GAPDATA, sizeof(__u32), &gap);

Is this a good approach or should we better find a general handling within
SOL_SOCKET here?

Regards,
Oliver
--
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