Skip to content

Commit

Permalink
- With ICMPv4 Type 3 Code 4 (fragmentation needed) to ICMPv6
Browse files Browse the repository at this point in the history
  translation, adjust the MTU size for the difference between the IPv4
  and IPv6 header size.  MTU size is to increase with this adjustment,
  but turns high limit into ETHERMTU.
  • Loading branch information
fujisawa committed Jul 5, 2002
1 parent c664a6b commit 01eecdd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions kame/sys/netinet6/natpt_trans.c
@@ -1,4 +1,4 @@
/* $KAME: natpt_trans.c,v 1.133 2002/07/02 15:29:01 fujisawa Exp $ */
/* $KAME: natpt_trans.c,v 1.134 2002/07/05 06:27:13 fujisawa Exp $ */

/*
* Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 and 2001 WIDE Project.
Expand Down Expand Up @@ -43,6 +43,7 @@
#include <sys/socket.h>
#include <sys/syslog.h>

#include <net/ethernet.h> /* for #define ETHERMTU */
#include <net/route.h> /* for <netinet6/ip6_var.h> */

#include <netinet/in.h>
Expand Down Expand Up @@ -1072,7 +1073,10 @@ natpt_icmp4Unreach(struct icmp *icmp4, struct icmp6_hdr *icmp6)
if (icmp4->icmp_nextmtu == 0)
icmp6->icmp6_mtu = IPV6_MMTU; /* xxx */
else
icmp6->icmp6_mtu = ntohs(icmp4->icmp_nextmtu); /* xxx */
icmp6->icmp6_mtu =
min(ETHERMTU,
ntohs(icmp4->icmp_nextmtu) +
(sizeof(struct ip6_hdr) - sizeof(struct ip)));
HTONL(icmp6->icmp6_mtu);
break;

Expand Down

0 comments on commit 01eecdd

Please sign in to comment.