mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Zhang haofeng" <zhanghf@blrcsv.china.bell-labs.com>
To: <linux-kernel@vger.kernel.org>
Subject: sk_buff problem
Date: Wed, 3 Sep 2003 12:47:24 +0800	[thread overview]
Message-ID: <008501c371d6$77d9d350$8112fc87@ZHANGHAOFENG> (raw)

Dear all,
    Does somebody have some knowledge about /net/ipv6/sit.c?
    I try to modify sit.c to cater for my requirements: I want to use
IPv4+UDP+IPv6+IPv6 Data to encapsulate IPv6 packets, thus every IPv6 packet
will be able to pass through some IPv4 NATs. As you know, sit.c is to
encapsulate IPv6 packets in IPv4 payload, so it seems that I only need to
add UDP layer between IPv4 header and IPv6 header in the encapsulated
packet.
    But I got problem when I receive an IPv4 UDP packet. I wanna
de-encapsulate the packet and send UDP data (which is an IPv6 packet) to
IPv6 upper layer protocol use netif_rx( ).  But it seems that I can not set
the correspondent field in sk_buff struct correctly.
    In sit.c, line 396, when 6to4 interface receive a IPv4 packet:
*****************
    if (!pskb_may_pull(skb, sizeof(struct ipv6hdr)))
        goto out;
...
    skb->mac.raw= skb->nh.raw;
    skb->nh.raw= skb-> data;
...
    netif_rx(skb);

    So in my modified sit.c, I modify the source code to :
*****************
    if (!pskb_may_pull(skb, sizeof(struct ipv6hdr)))
        goto out;
...
    skb->mac.raw= skb->nh.raw;
    skb->nh.raw= skb->data+sizeof(struct udphdr);
    skb->protocol = __constant_htons(0x86DD);
...
    netif_rx(skb);
...

    But it seems that I can not send the IPv6 packet to IPv6 upper layer,
while the ICMPv4 UDP port unreachable message is sent to the sender. I am
confused :(
    Any kind of  help is appreciated.

Zhanghaofeng
Sep 3rd, 2003



             reply	other threads:[~2003-09-03  4:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-03  4:47 Zhang haofeng [this message]
2003-09-04  7:42 Zhang haofeng

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='008501c371d6$77d9d350$8112fc87@ZHANGHAOFENG' \
    --to=zhanghf@blrcsv.china.bell-labs.com \
    --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

Powered by JetHome