[lkml]   [2001]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Question about ipip implementation
> I read net/ipv4/ipip.c. It seems to me that ipip_rcv() function after
> "unwrapping" tunelled IP packet creates "virtual Ethernet header" and submit

Does it? ipip_rcv() does this:

iph = skb->nh.iph;
skb->mac.raw = skb->nh.raw;

i.e. the "MAC header" pointer of the packet is the same as the IP
header, iow. no MAC header available

skb->nh.raw = skb->data;

Although I don't exactly understand this :-) it does not add a header

memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));

this must be cleared before processing the packet

skb->protocol = __constant_htons(ETH_P_IP);
skb->pkt_type = PACKET_HOST;

mark it as an IP packet

if ((tunnel = ipip_tunnel_lookup(iph->saddr, iph->daddr)) != NULL) {
tunnel->stat.rx_bytes += skb->len;
skb->dev = tunnel->dev;

mark the incoming device

skb->dst = NULL;
skb->nfct = NULL;
skb->nf_debug = 0;

more clearing of fields / release of resources associated with the packet

ipip_ecn_decapsulate(iph, skb);

handle ECN flags


The packet as submitted starts with the IP header and the skb pointers
are set up so that the MAC header has zero size.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:52    [W:0.065 / U:22.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site