Re: Problems with the IP tunnel

really kuznet@ms2.inr.ac.ru (inr-linux-kernel@ms2.inr.ac.ru)
25 Jun 1996 22:47:09 +0400


Jon Tombs (jon@gte.ESi.US.ES) wrote:

: Looking at new_tunnel.c there are a few things I don't understand.
: ...
: memcpy(new_skb->ip_hdr, skb->data, skb->len);
: This copies the data - OK
: memset(new_skb->proto_priv, 0, sizeof(skb->proto_priv));
: Zero the proto_priv field - WHY don't we copy?

This field is used by precompiled IP options (name was obscured
deliberately in order to core/* not to depend on IP layer).
new_tunnel is about to build new IP header without IP options,
so that we must clear it.

: WHY don't we copy the other fields from the old skb?
: i.e. what about saddr,daddr,raddr and pkt_type??

ip_forward need not saddr,daddr and fills raddr itself.
pkt_type is set to PKT_HOST by alloc_skb, that is correct.

Alexey Kuznetsov.