Add a missing piece from RFC 3542. KAME-NetBSD-current branch

revision 1.1.1.2.2.5:
	do not call pfctlinput2(PRC_MSGSIZE) on fragmentation to avoid
	notification storm

From Keiichi SHIMA:
  "In the current NetBSD code, the PRC_MSGSIZE message will be generated
   for every fragmented packets when a node is trying to send a big
   packet. That was the intermediate behavior while RFC3542 was under
   discussion."

By (obviously) the KAME project.
This commit is contained in:
rpaulo 2006-07-08 19:58:40 +00:00
parent 79d3d94bff
commit 4e0b046439

View File

@ -1,4 +1,4 @@
/* $NetBSD: ip6_output.c,v 1.98 2006/05/14 21:19:34 elad Exp $ */
/* $NetBSD: ip6_output.c,v 1.99 2006/07/08 19:58:40 rpaulo Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.98 2006/05/14 21:19:34 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.99 2006/07/08 19:58:40 rpaulo Exp $");
#include "opt_inet.h"
#include "opt_inet6.h"
@ -946,8 +946,10 @@ skip_ipsec2:;
struct ip6_frag *ip6f;
u_int32_t id = htonl(ip6_randomid());
u_char nextproto;
#if 0 /* see below */
struct ip6ctlparam ip6cp;
u_int32_t mtu32;
#endif
/*
* Too large for the destination or interface;
@ -958,12 +960,24 @@ skip_ipsec2:;
if (mtu > IPV6_MAXPACKET)
mtu = IPV6_MAXPACKET;
#if 0
/*
* It is believed this code is a leftover from the
* development of the IPV6_RECVPATHMTU sockopt and
* associated work to implement RFC3542.
* It's not entirely clear what the intent of the API
* is at this point, so disable this code for now.
* The IPV6_RECVPATHMTU sockopt and/or IPV6_DONTFRAG
* will send notifications if the application requests.
*/
/* Notify a proper path MTU to applications. */
mtu32 = (u_int32_t)mtu;
bzero(&ip6cp, sizeof(ip6cp));
ip6cp.ip6c_cmdarg = (void *)&mtu32;
pfctlinput2(PRC_MSGSIZE, (struct sockaddr *)&ro_pmtu->ro_dst,
(void *)&ip6cp);
#endif
len = (mtu - hlen - sizeof(struct ip6_frag)) & ~7;
if (len < 8) {