netdev
[Top] [All Lists]

Re: Is mac address reference safe w/ zero copy?

To: rusty@xxxxxxxxxxxxxxxx (Rusty Russell)
Subject: Re: Is mac address reference safe w/ zero copy?
From: kuznet@xxxxxxxxxxxxx
Date: Thu, 8 Feb 2001 22:20:56 +0300 (MSK)
Cc: netdev@xxxxxxxxxxx
In-reply-to: <E14QTTs-0005Yn-00@halfway> from "Rusty Russell" at Feb 8, 1 11:15:00 am
Sender: owner-netdev@xxxxxxxxxxx
Hello!

The answer to the question is "yes".


>       The following code in route.c:ip_route_input_slow()
> 
>               if (dev->hard_header_len) {

But this code is buggy even without split skbs! Good discovery. 8)
mac.raw+dev->hard_header_len is not guaranteed to be inside packet.
It should terminate at skb->tail.


Generally, each level has its headers on their usual place.
If you are inside IP, mac and ip headers are there, where you
expect them. But udp/tcp/icmp headers are _not_, they are pulled
only by udp/tcp/icmp modules.

Actually, the biggest advantage of split skbs is that it forces
to think about such questions. 8) Look f.e. into 2.2: trans.proxy
and masquerading make hundred of illegal accesses to protocol
headers.

Paul, could you send me snapshots of your work on this?
Probably, we could make this faster and more clean then.

Alexey

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