* Mac address in network stack.
@ 2005-10-29 12:09 Rasmus Bøg Hansen
0 siblings, 0 replies; only message in thread
From: Rasmus Bøg Hansen @ 2005-10-29 12:09 UTC (permalink / raw)
To: Linux Kernel Mailing List
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 ] --
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-10-29 12:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-29 12:09 Mac address in network stack Rasmus Bøg Hansen
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®