From: moffe@zz9.dk (Rasmus Bøg Hansen)
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Mac address in network stack.
Date: Sat, 29 Oct 2005 14:09:00 +0200 [thread overview]
Message-ID: <87u0f0le3n.fsf@grignard.amagerkollegiet.dk> (raw)
Hi
I am trying to adapt a sched module (WRR, a sched class and qdisc) to
the 2.6 kernel. It was originally coded for 2.2 and classified hosts
by their mac address. Later it got classification for IP and with 2.4
MAC support was deactivated as this apparently was done in another way
in 2.4. I am now trying to reimplement the MAC support but have run
into trouble...
In 2.2 the mac address of the sender and receiver of the packet was
found by eg.:
memcpy(addr,skb->mac.ethernet->h_source,ETH_ALEN);
memcpy(addr,skb->mac.ethernet->h_dest,ETH_ALEN);
This was apparently possible only when running in bridging mode. In
the 2.6 kernel this seems to be able to do by eg.:
memcpy(addr,eth_hdr(skb)->h_source, ETH_ALEN);
memcpy(addr,eth_hdr(skb)->h_dest, ETH_ALEN);
However eth_hdr() seems to return a NULL pointer (really a pointer to
skb->mac.raw), even when running in bridge mode.
I see this as a sign that the mac address is not available in this
layer of the network stack. Is this true or am I just trying to fetch
the MAC address in the wrong way?
Thanks in advance
/Rasmus
--
-- [ Rasmus "Møffe" Bøg Hansen ] ---------------------------------------
If there are no stupid questions, then what kind of questions do stupid
people ask? Do they get smart just in time to ask questions?
----------------------------------------------[ moffe at zz9 dot dk ] --
reply other threads:[~2005-10-29 12:09 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=87u0f0le3n.fsf@grignard.amagerkollegiet.dk \
--to=moffe@zz9.dk \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®