All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amin Azez <azez@ufomechanic.net>
To: netfilter-devel@lists.netfilter.org
Subject: skb->mac.raw, when is does it point to ethhdr
Date: Thu, 28 Apr 2005 17:29:35 +0100	[thread overview]
Message-ID: <d4r2n4$o39$1@sea.gmane.org> (raw)

I've been treating skb->mac.raw as a pointer to ethhdr and stealing mac 
addresses when conntrack's are created.

So the question comes up, how do we tell when skb->mac.raw is pointing 
to an ethernet frame header and when it is pointing to something else?

I found a case even in ethernet only systems where if traffic is sent to 
a non-existant host then some associated skb have skb->mac.raw not NULL 
but also point to something else, or at least something quite bogus, for 
my to copy mac address memcpy was tying to copy sizeof(ethhdr) from 
fbdb1200, or sometimes from such addresses as 003ba300, which indictaes 
sometimes it is not even a valid pointer to anywhere. I got:

Unable to handle kernel paging request at virtual address fbdb1200

So I need to find out how to tell when skb->mac.raw points to a valid 
ethhdr struct.

The clue must be in sk_buff somewhere.

net_device, a likely candidate seems too opaque, with nothing to 
indicate device type, or link layer header struct type.

I guess I could look for skb->mac_len to be the same as ethernet maclen, 
but thats a cheat.

Thats about all I can find.

Any ideas?

Amin

             reply	other threads:[~2005-04-28 16:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-28 16:29 Amin Azez [this message]
2005-04-28 17:24 ` skb->mac.raw, when is does it point to ethhdr YOSHIFUJI Hideaki / 吉藤英明
2005-04-29 10:01   ` Amin Azez
2005-04-29 14:52 ` Henrik Nordstrom
2005-04-29 15:54   ` wow, why does everything presume ethernet? " Amin Azez
2005-05-01 20:54     ` Henrik Nordstrom
2005-05-03  8:23       ` Amin Azez

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='d4r2n4$o39$1@sea.gmane.org' \
    --to=azez@ufomechanic.net \
    --cc=netfilter-devel@lists.netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.