Bug 49761 - [tunnel SIT]can not generate ICMPv6 message directed back to original IPv6 node
Summary: [tunnel SIT]can not generate ICMPv6 message directed back to original IPv6 node
Status: NEW
Alias: None
Product: Networking
Classification: Unclassified
Component: IPV6 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Hideaki YOSHIFUJI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-30 07:40 UTC by ychen
Modified: 2016-02-15 20:34 UTC (History)
1 user (show)

See Also:
Kernel Version: 3.5.4
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description ychen 2012-10-30 07:40:56 UTC
in RFC 4213, section 3.4, page 11, it says:
If sufficient data bytes from the offending packet are available, the
   encapsulator MAY extract the encapsulated IPv6 packet and use it to
   generate an ICMPv6 message directed back to the originating IPv6
   node, as shown below:

                         +--------------+
                         | IPv4 Header  |
                         | dst = encaps |
                         |       node   |
                         +--------------+
                         |    ICMPv4    |
                         |    Header    |
                  - -    +--------------+
                         | IPv4 Header  |
                         | src = encaps |
                 IPv4    |       node   |
                         +--------------+   - -
                 Packet  |    IPv6      |
                         |    Header    |   Original IPv6
                  in     +--------------+   Packet -
                         |  Transport   |   Can be used to
                 Error   |    Header    |   generate an
                         +--------------+   ICMPv6
                         |              |   error message
                         ~     Data     ~   back to the source.
                         |              |
                  - -    +--------------+   - -

but in the code, when receive a encapsulated ICMPv4 error packet, the stack is this:
ip_rcv()->icmp_rcv()->icmp_unreach()->tunnel64_err()->ipip6_err()

and in function ipip6_err(), it just use the src ipv4 and dst ipv4 address to get tunnel interface, but not decapsulate the packet or check whether there is enough ipv6 information in the packet. so when this function finish, use skb_free(), then the packet is dropped.

so now i want to know, how to resolve this problem? can you give me a patch?

Note You need to log in before you can comment on or make changes to this bug.