mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Olaf Titz <olaf@bigred.inka.de>
To: linux-kernel@vger.kernel.org
Subject: Re: Question about ipip implementation
Date: Sun, 13 May 2001 15:16:28 +0200	[thread overview]
Message-ID: <E14yvjd-0002Rw-00@g212.hadiko.de> (raw)
In-Reply-To: <20010511173940.A418@Hews1193nrc>

> 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

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

mark the incoming device

		dst_release(skb->dst);
		skb->dst = NULL;
#ifdef CONFIG_NETFILTER
		nf_conntrack_put(skb->nfct);
		skb->nfct = NULL;
#ifdef CONFIG_NETFILTER_DEBUG
		skb->nf_debug = 0;
#endif
#endif

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

		ipip_ecn_decapsulate(iph, skb);

handle ECN flags

		netif_rx(skb);

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

Olaf

  parent reply	other threads:[~2001-05-13 13:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20010516102436.B1972@Hews1193nrc>
2001-05-11 14:39 ` Alexey Vyskubov
2001-05-12 17:40   ` Andi Kleen
2001-05-13 13:16   ` Olaf Titz [this message]
2001-05-14 11:07     ` Alexey Vyskubov
2001-05-15 11:15     ` Olaf Titz
2001-05-16  7:53       ` Olaf Titz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E14yvjd-0002Rw-00@g212.hadiko.de \
    --to=olaf@bigred.inka.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®