netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Parse ethernet headers in af_packet.c
Date: Wed, 31 Jul 2013 19:27:44 +0200	[thread overview]
Message-ID: <1375291667-9572-1-git-send-email-phil@nwl.cc> (raw)
In-Reply-To: <20130729165357.GA23134@orbit.nwl.cc>

Hi,

This is an AF_PACKET specific solution to the problems discussed in [1]
and [2].

Basically this incorporates calling eth_type_trans() for packets to send
when the outgoing device's type is ARPHRD_ETHER.

In order to having a more generic solution which could be used in other
places (like e.g. tun.c), I second Michael's approach in [2], but would
extend it to a generic equivalent to eth_type_trans(). A device-type
specific layer-2 header parser if you will. Note that eth_type_trans()
also sets skbuff's dev, pkt_type and mac_header fields. A
dev->header_ops->type_trans() could do just that plus set skb->protocol
(maybe only if it's ETH_P_ALL).

[1] http://patchwork.ozlabs.org/patch/67422/
[2] http://lists.openwall.net/netdev/2010/01/06/38

Best wishes, Phil

  reply	other threads:[~2013-07-31 17:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-29 16:53 packet_mmap, 802.1Q and bridges Phil Sutter
2013-07-31 17:27 ` Phil Sutter [this message]
2013-07-31 17:27   ` [PATCH 1/3] af_packet: when sending ethernet frames, parse header for skb->protocol Phil Sutter
2013-07-31 17:27     ` [PATCH 2/3] af_packet: fix for sending VLAN frames via packet_mmap Phil Sutter
2013-07-31 17:27       ` [PATCH 3/3] af_packet: simplify VLAN frame check in packet_snd Phil Sutter
2013-08-01  0:30     ` [PATCH 1/3] af_packet: when sending ethernet frames, parse header for skb->protocol David Miller
2013-08-01 10:35       ` Phil Sutter
2013-08-02  1:12         ` David Miller
2013-08-02  9:37           ` [PATCH v2 " Phil Sutter
2013-08-02  9:37             ` [PATCH v2 2/3] af_packet: fix for sending VLAN frames via packet_mmap Phil Sutter
2013-08-02  9:37               ` [PATCH v2 3/3] af_packet: simplify VLAN frame check in packet_snd Phil Sutter
2013-08-02 21:59                 ` David Miller
2013-08-02 21:58               ` [PATCH v2 2/3] af_packet: fix for sending VLAN frames via packet_mmap David Miller
2013-08-02 21:58             ` [PATCH v2 1/3] af_packet: when sending ethernet frames, parse header for skb->protocol David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1375291667-9572-1-git-send-email-phil@nwl.cc \
    --to=phil@nwl.cc \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).