netdev
[Top] [All Lists]

Re: skbuff variables set already in ethernet drivers

To: Guilhem Tardy <guilhem_tardy@xxxxxxxxx>
Subject: Re: skbuff variables set already in ethernet drivers
From: Ben Greear <greearb@xxxxxxxxxxxxxxx>
Date: Mon, 17 Sep 2001 16:56:58 -0700
Cc: netdev@xxxxxxxxxxx
Organization: Candela Technologies
References: <20010917223259.71870.qmail@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
Guilhem Tardy wrote:
> 
> Hello,
> 
> I tried to modify the 3c59x.c driver some time ago, unsuccessfully. I now want
> to get around those difficulties, could you help?
> 
> My goal is to add an unsigned long value in all UDP packets received on a
> particular port. This value represents the current time from a custom rtc 
> timer
> (8192Hz). I also modified ip_input.c and udp.c for the same purpose. 
> Obviously,
> I had to turn off the checksum in 3c59x.c and udp.c.
> 
> The problem is that I don't know where skbuff.{data, mac.ethernet} point to in
> 3c59x.c (or any driver, for what it matters)? As a result, the value is
> probably copied in the wrong place.

Well, the driver is given whole ethernet frames to ship, right?
In other words, data points to the beginning of the ethernet header
by the time the driver sees the skb.  I wouldn't trust mac.ethernet
on transmitted skb, btw:  I don't think it is (uniformly??) set.

So, you know the first 12 bytes are MAC addresses, the next 2 are length/proto,
and the IP header will start after that....

Ben

-- 
Ben Greear <greearb@xxxxxxxxxxxxxxx>          <Ben_Greear@xxxxxxxxxx>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear

<Prev in Thread] Current Thread [Next in Thread>