netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marc A. Pelletier" <marc@abovesecurity.com>
To: netdev@vger.kernel.org
Subject: [PATCH 2.6.20] Corrects small word-size dependency in exposed kernel structure
Date: Fri, 11 May 2007 06:01:03 -0400	[thread overview]
Message-ID: <46443EDF.1080108@abovesecurity.com> (raw)

Corrects a small word-size dependency in an exposed kernel structure
so that mmaped packet sockets will work correctly from 32-bit userspace
on a 64-bit kernel.

Signed-off-by: Marc A. Pelletier <marc@abovesecurity.com>
---

As an aside, I've considered changing the setsockopt() for that feature
so that it returns critical values back to userspace (stride between
frames, actual offsets of substructures) rather than needing userspace
to guess them, but that can't be done without

(a) breaking current users of PACKET_RX_RING; or
(b) adding a new setsockopt.

Which is best?

Also, I have a couple of sanity fixes for the ring packet implementation
I'd like to discuss.  Anyone specific maintaining that bit of code?

-- Marc A. Pelletier

--- orig/include/linux/if_packet.h      2007-05-10 14:27:49 -0400
+++ new/include/linux/if_packet.h   2007-05-10 14:27:50 -0400
@@ -50,7 +50,7 @@

 struct tpacket_hdr
 {
-       unsigned long   tp_status;
+       unsigned int    tp_status;
 #define TP_STATUS_KERNEL       0
 #define TP_STATUS_USER         1
 #define TP_STATUS_COPY         2






                 reply	other threads:[~2007-05-11 14:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=46443EDF.1080108@abovesecurity.com \
    --to=marc@abovesecurity.com \
    --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).