[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-netdev
Subject:    [PATCH] IPv6: (1/5) Fix bugs in ip6_tunnel.c ICMP error handler
From:       Ville Nuorvala <vnuorval () tcs ! hut ! fi>
Date:       2003-08-31 23:34:55
[Download RAW message or body]

Hi,

this patch fixes two byte order bugs in ip6ip6_err(). Please apply!

Thanks,
Ville
--
Ville Nuorvala
Research Assistant, Institute of Digital Communications,
Helsinki University of Technology
email: vnuorval@tcs.hut.fi, phone: +358 (0)9 451 5257

["ip6_tnl_icmp_err.patch" (TEXT/PLAIN)]

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1276.1.15 -> 1.1276.28.1
#	net/ipv6/ip6_tunnel.c	1.6     -> 1.7    
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/09/01	vnuorval@dsl-hkigw1a8b.dial.inet.fi	1.1276.28.1
# Fix byte order of info parameter in ip6ip6_err()
# --------------------------------------------
#
diff -Nru a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
--- a/net/ipv6/ip6_tunnel.c	Mon Sep  1 02:02:59 2003
+++ b/net/ipv6/ip6_tunnel.c	Mon Sep  1 02:02:59 2003
@@ -421,7 +421,7 @@
 		}
 		teli = parse_tlv_tnl_enc_lim(skb, skb->data);
 
-		if (teli && teli == info - 2) {
+		if (teli && teli == ntohl(info) - 2) {
 			tel = (struct ipv6_tlv_tnl_enc_lim *) &skb->data[teli];
 			if (tel->encap_limit == 0) {
 				if (net_ratelimit())
@@ -434,10 +434,9 @@
 		}
 		break;
 	case ICMPV6_PKT_TOOBIG:
-		mtu = info - offset;
-		if (mtu <= IPV6_MIN_MTU) {
+		mtu = ntohl(info) - offset;
+		if (mtu < IPV6_MIN_MTU)
 			mtu = IPV6_MIN_MTU;
-		}
 		t->dev->mtu = mtu;
 
 		if ((len = sizeof (*ipv6h) + ipv6h->payload_len) > mtu) {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic