All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amin Azez <azez@ufomechanic.net>
To: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@wide.ad.jp>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: skb->mac.raw, when is does it point to ethhdr
Date: Fri, 29 Apr 2005 11:01:05 +0100	[thread overview]
Message-ID: <427205E1.1000405@ufomechanic.net> (raw)
In-Reply-To: <20050429.022401.71711919.yoshfuji@wide.ad.jp>

YOSHIFUJI Hideaki / 吉藤英明 wrote:

>In article <d4r2n4$o39$1@sea.gmane.org> (at Thu, 28 Apr 2005 17:29:35 +0100), Amin Azez <azez@ufomechanic.net> says:
>  
>
>>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?
>>    
>>
>Basically, the hardware header (ether frame) is resolved / appended
>in the ip_finish_output2() (for IPv4) or ip6_output_finish() (for IPv6),
>after POST_ROUTING.
>Thus, in the POST_ROUTING (or before the POST_ROUTING),
>hardware header (ether frame) is not available (in most cases).
>  
>
Thanks, for this, but the question is more complex.
conntrack only gets to inspect packets in PREROUTING and OUTPUT phases.
In this problem case the packet was originating from the local machine 
and so as you pointed out the mac info won't be setup until POSTROUTING.

Generally I am only interesting in collecting mac addresses in PREROUTING.
I suppose I need to know which phase of netfilter triggered the 
conntrack that triggered me. Until then I have stolen the ancient 
bridging check which makes sure that skb->mac.raw points to somewhere 
within skb, so I can tell it is at least a valid pointer.

Is there anyway to tell if skb>mac.raw it points to an ethernet mac 
address, or an X25 linklayer address, or appletalk, etc?
Having a valid pointer is one thing, but knowing what it points to is 
another.

Thanks

Amin

  reply	other threads:[~2005-04-29 10:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-28 16:29 skb->mac.raw, when is does it point to ethhdr Amin Azez
2005-04-28 17:24 ` YOSHIFUJI Hideaki / 吉藤英明
2005-04-29 10:01   ` Amin Azez [this message]
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=427205E1.1000405@ufomechanic.net \
    --to=azez@ufomechanic.net \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=yoshfuji@wide.ad.jp \
    /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.