]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
sit: correct IP protocol used in ipip6_err
authorSimon Horman <simon.horman@netronome.com>
Thu, 16 Jun 2016 08:06:19 +0000 (17:06 +0900)
committerWilly Tarreau <w@1wt.eu>
Sat, 27 Aug 2016 09:40:20 +0000 (11:40 +0200)
commitd09f7f9a7b70ce6cf3439a5b6c953e057c157dd7
treef8dbb8f4bec140a6efcebddfe6865cf441979810
parent801b100b137e407e036c282be0191db9f9887e3f
sit: correct IP protocol used in ipip6_err

commit d5d8760b78d0cfafe292f965f599988138b06a70 upstream.

Since 32b8a8e59c9c ("sit: add IPv4 over IPv4 support")
ipip6_err() may be called for packets whose IP protocol is
IPPROTO_IPIP as well as those whose IP protocol is IPPROTO_IPV6.

In the case of IPPROTO_IPIP packets the correct protocol value is not
passed to ipv4_update_pmtu() or ipv4_redirect().

This patch resolves this problem by using the IP protocol of the packet
rather than a hard-coded value. This appears to be consistent
with the usage of the protocol of a packet by icmp_socket_deliver()
the caller of ipip6_err().

I was able to exercise the redirect case by using a setup where an ICMP
redirect was received for the destination of the encapsulated packet.
However, it appears that although incorrect the protocol field is not used
in this case and thus no problem manifests.  On inspection it does not
appear that a problem will manifest in the fragmentation needed/update pmtu
case either.

In short I believe this is a cosmetic fix. None the less, the use of
IPPROTO_IPV6 seems wrong and confusing.

Reviewed-by: Dinan Gunawardena <dinan.gunawardena@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/ipv6/sit.c