<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/if_packet.h, branch v3.0.50</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.0.50</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.0.50'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2011-06-07T05:42:06Z</updated>
<entry>
<title>af_packet: prevent information leak</title>
<updated>2011-06-07T05:42:06Z</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2011-06-07T05:42:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=13fcb7bd322164c67926ffe272846d4860196dc6'/>
<id>urn:sha1:13fcb7bd322164c67926ffe272846d4860196dc6</id>
<content type='text'>
In 2.6.27, commit 393e52e33c6c2 (packet: deliver VLAN TCI to userspace)
added a small information leak.

Add padding field and make sure its zeroed before copy to user.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
CC: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>af-packet: Add flag to distinguish VID 0 from no-vlan.</title>
<updated>2011-06-02T04:18:03Z</updated>
<author>
<name>Ben Greear</name>
<email>greearb@candelatech.com</email>
</author>
<published>2011-06-01T06:49:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a3bcc23e890a6d49d6763d9eb073d711de2e0469'/>
<id>urn:sha1:a3bcc23e890a6d49d6763d9eb073d711de2e0469</id>
<content type='text'>
Currently, user-space cannot determine if a 0 tcp_vlan_tci
means there is no VLAN tag or the VLAN ID was zero.

Add flag to make this explicit.  User-space can check for
TP_STATUS_VLAN_VALID || tp_vlan_tci &gt; 0, which will be backwards
compatible. Older could would have just checked for tp_vlan_tci,
so it will work no worse than before.

Signed-off-by: Ben Greear &lt;greearb@candelatech.com&gt;
Acked-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>packet_mmap: expose hw packet timestamps to network packet capture utilities</title>
<updated>2010-06-02T12:53:56Z</updated>
<author>
<name>Scott McMillan</name>
<email>scott.a.mcmillan@intel.com</email>
</author>
<published>2010-06-02T12:53:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=614f60fa9d73a9e8fdff3df83381907fea7c5649'/>
<id>urn:sha1:614f60fa9d73a9e8fdff3df83381907fea7c5649</id>
<content type='text'>
This patch adds a setting, PACKET_TIMESTAMP, to specify the packet
timestamp source that is exported to capture utilities like tcpdump by
packet_mmap.

PACKET_TIMESTAMP accepts the same integer bit field as
SO_TIMESTAMPING.  However, only the SOF_TIMESTAMPING_SYS_HARDWARE and
SOF_TIMESTAMPING_RAW_HARDWARE values are currently recognized by
PACKET_TIMESTAMP.  SOF_TIMESTAMPING_SYS_HARDWARE takes precedence over
SOF_TIMESTAMPING_RAW_HARDWARE if both bits are set.

If PACKET_TIMESTAMP is not set, a software timestamp generated inside
the networking stack is used (the behavior before this setting was
added).

Signed-off-by: Scott McMillan &lt;scott.a.mcmillan@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>packet: support for TX time stamps on RAW sockets</title>
<updated>2010-04-13T08:30:48Z</updated>
<author>
<name>Richard Cochran</name>
<email>richardcochran@gmail.com</email>
</author>
<published>2010-04-07T22:41:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ed85b565b825566da34e55eee9ad150ed93fdda0'/>
<id>urn:sha1:ed85b565b825566da34e55eee9ad150ed93fdda0</id>
<content type='text'>
Enable the SO_TIMESTAMPING socket infrastructure for raw packet sockets.
We introduce PACKET_TX_TIMESTAMP for the control message cmsg_type.

Similar support for UDP and CAN sockets was added in commit
51f31cabe3ce5345b51e4a4f82138b38c4d5dc91

Signed-off-by: Richard Cochran &lt;richard.cochran@omicron.at&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>packet: Add GSO/csum offload support.</title>
<updated>2010-02-05T04:24:10Z</updated>
<author>
<name>Sridhar Samudrala</name>
<email>sri@us.ibm.com</email>
</author>
<published>2010-02-05T04:24:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bfd5f4a3d605e0f6054df0b59fe0907ff7e696d3'/>
<id>urn:sha1:bfd5f4a3d605e0f6054df0b59fe0907ff7e696d3</id>
<content type='text'>
This patch adds GSO/checksum offload to af_packet sockets using
virtio_net_hdr. Based on Rusty's patch to add this support to tun.
It allows GSO/checksum offload to be enabled when using raw socket
backend with virtio_net.
Adds PACKET_VNET_HDR socket option to prepend virtio_net_hdr in the
receive path and process/skip virtio_net_hdr in the send path. This
option is only allowed with SOCK_RAW sockets attached to ethernet
type devices.

v2 updates
----------
Michael's Comments
- Perform length check in packet_snd() when GSO is off even when
  vnet_hdr is present.
- Check for SKB_GSO_FCOE type and return -EINVAL
- don't allow tx/rx ring when vnet_hdr is enabled.
Herbert's Comments
- Removed ethernet specific code.
- protocol value is assumed to be passed in by the caller.

Signed-off-by: Sridhar Samudrala &lt;sri@us.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: cleanup include/linux</title>
<updated>2009-11-04T17:50:58Z</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2009-11-04T17:50:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d94d9fee9fa4e66a0b91640a694b8b10177075b3'/>
<id>urn:sha1:d94d9fee9fa4e66a0b91640a694b8b10177075b3</id>
<content type='text'>
This cleanup patch puts struct/union/enum opening braces,
in first line to ease grep games.

struct something
{

becomes :

struct something {

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Revert "af_packet: add interframe drop cmsg (v6)"</title>
<updated>2009-10-12T10:00:31Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2009-10-12T10:00:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d5e63bded6e819ca77ee1a1d97c783a31f6caf30'/>
<id>urn:sha1:d5e63bded6e819ca77ee1a1d97c783a31f6caf30</id>
<content type='text'>
This reverts commit 977750076d98c7ff6cbda51858bb5a5894a9d9ab.

Neil is reimplementing this generically, outside of AF_PACKET.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>af_packet: add interframe drop cmsg (v6)</title>
<updated>2009-10-05T07:21:55Z</updated>
<author>
<name>Neil Horman</name>
<email>nhorman@tuxdriver.com</email>
</author>
<published>2009-10-02T06:56:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=977750076d98c7ff6cbda51858bb5a5894a9d9ab'/>
<id>urn:sha1:977750076d98c7ff6cbda51858bb5a5894a9d9ab</id>
<content type='text'>
Add Ancilliary data to better represent loss information

I've had a few requests recently to provide more detail regarding frame loss
during an AF_PACKET packet capture session.  Specifically the requestors want to
see where in a packet sequence frames were lost, i.e. they want to see that 40
frames were lost between frames 302 and 303 in a packet capture file.  In order
to do this we need:

1) The kernel to export this data to user space
2) The applications to make use of it

This patch addresses item (1).  It does this by doing the following:

A) Anytime we drop a frame for which we would increment po-&gt;stats.tp_drops, we
also no increment a stats called po-&gt;stats.tp_gap.

B) Every time we successfully enqueue a frame to sk_receive_queue, we record the
value of po-&gt;stats.tp_gap in skb-&gt;mark.  skb-&gt;cb would nominally be the place to
record this, but since all the space there is used up, we're overloading
skb-&gt;mark.  Its safe to do since any enqueued packet is guaranteed to be
unshared at this point, and skb-&gt;mark isn't used for anything else in the rx
path to the application.  After we record tp_gap in the skb, we zero
po-&gt;stats.tp_gap.  This allows us to keep a counter of the number of frames lost
between any two enqueued packets

C) When the application goes to dequeue a frame from the packet socket, we look
at skb-&gt;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.

Note there is a chance that if there is frame loss after a receive, and then the
socket is closed, some gap data might be lost.  This is covered by the use of
the PACKET_AUXDATA socket option, which gives total loss data.  With a bit of
math, the final gap can be determined that way.

I've tested this patch myself, and it works well.

Signed-off-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;

 include/linux/if_packet.h |    2 ++
 net/packet/af_packet.c    |   33 +++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>af_packet: Teach to listen for multiple unicast addresses.</title>
<updated>2009-05-21T22:13:39Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2009-05-19T18:27:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d95ed9275edcb8995bda31005bb3f55e087626d7'/>
<id>urn:sha1:d95ed9275edcb8995bda31005bb3f55e087626d7</id>
<content type='text'>
The the PACKET_ADD_MEMBERSHIP and the PACKET_DROP_MEMBERSHIP setsockopt
calls for af_packet already has all of the infrastructure needed to subscribe
to multiple mac addresses.  All that is missing is a flag to say that
the address we want to listen on is a unicast address.

So introduce PACKET_MR_UNICAST and wire it up to dev_unicast_add and
dev_unicast_delete.

Additionally I noticed that errors from dev_mc_add were not propagated
from packet_dev_mc so fix that.

Signed-off-by: Eric W. Biederman &lt;ebiederm@aristanetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: TX_RING and packet mmap</title>
<updated>2009-05-19T05:11:22Z</updated>
<author>
<name>Johann Baudy</name>
<email>johann.baudy@gnu-log.net</email>
</author>
<published>2009-05-19T05:11:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=69e3c75f4d541a6eb151b3ef91f34033cb3ad6e1'/>
<id>urn:sha1:69e3c75f4d541a6eb151b3ef91f34033cb3ad6e1</id>
<content type='text'>
New packet socket feature that makes packet socket more efficient for
transmission.

- It reduces number of system call through a PACKET_TX_RING mechanism,
  based on PACKET_RX_RING (Circular buffer allocated in kernel space
  which is mmapped from user space).

- It minimizes CPU copy using fragmented SKB (almost zero copy).

Signed-off-by: Johann Baudy &lt;johann.baudy@gnu-log.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
