Print this page
7819 IPv6 Packet and MTU bug


   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.

  25  */
  26 /* Copyright (c) 1990 Mentat Inc. */
  27 
  28 #include <sys/types.h>
  29 #include <sys/stream.h>
  30 #include <sys/strsubr.h>
  31 #include <sys/dlpi.h>
  32 #include <sys/strsun.h>
  33 #include <sys/zone.h>
  34 #include <sys/ddi.h>
  35 #include <sys/sunddi.h>
  36 #include <sys/cmn_err.h>
  37 #include <sys/debug.h>
  38 #include <sys/atomic.h>
  39 
  40 #include <sys/systm.h>
  41 #include <sys/param.h>
  42 #include <sys/kmem.h>
  43 #include <sys/sdt.h>
  44 #include <sys/socket.h>


 228         if (IN6_IS_ADDR_LINKSCOPE(&dst))
 229                 ifindex = nce->nce_common->ncec_ill->ill_phyint->phyint_ifindex;
 230 
 231         dce = dce_lookup_v6(&dst, ifindex, ipst, NULL);
 232         ASSERT(dce != NULL);
 233 
 234         if (!(ixaflags & IXAF_PMTU_DISCOVERY)) {
 235                 ixa->ixa_fragsize = IPV6_MIN_MTU;
 236         } else if (dce->dce_flags & DCEF_PMTU) {
 237                 /*
 238                  * To avoid a periodic timer to increase the path MTU we
 239                  * look at dce_last_change_time each time we send a packet.
 240                  */
 241                 now = ddi_get_lbolt64();
 242                 if (TICK_TO_SEC(now) - dce->dce_last_change_time >
 243                     ipst->ips_ip_pathmtu_interval) {
 244                         /*
 245                          * Older than 20 minutes. Drop the path MTU information.
 246                          */
 247                         mutex_enter(&dce->dce_lock);
 248                         dce->dce_flags &= ~(DCEF_PMTU|DCEF_TOO_SMALL_PMTU);
 249                         dce->dce_last_change_time = TICK_TO_SEC(now);
 250                         mutex_exit(&dce->dce_lock);
 251                         dce_increment_generation(dce);
 252                         ixa->ixa_fragsize = ip_get_base_mtu(nce->nce_ill, ire);
 253                 } else {
 254                         uint_t fragsize;
 255 
 256                         fragsize = ip_get_base_mtu(nce->nce_ill, ire);
 257                         if (fragsize > dce->dce_pmtu)
 258                                 fragsize = dce->dce_pmtu;
 259                         ixa->ixa_fragsize = fragsize;
 260                 }
 261         } else {
 262                 ixa->ixa_fragsize = ip_get_base_mtu(nce->nce_ill, ire);
 263         }
 264 
 265         /*
 266          * We use use ire_nexthop_ill (and not ncec_ill) to avoid the under ipmp
 267          * interface for source address selection.
 268          */




   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  * Copyright 2017 OmniTI Computer Consulting, Inc. All rights reserved.
  26  */
  27 /* Copyright (c) 1990 Mentat Inc. */
  28 
  29 #include <sys/types.h>
  30 #include <sys/stream.h>
  31 #include <sys/strsubr.h>
  32 #include <sys/dlpi.h>
  33 #include <sys/strsun.h>
  34 #include <sys/zone.h>
  35 #include <sys/ddi.h>
  36 #include <sys/sunddi.h>
  37 #include <sys/cmn_err.h>
  38 #include <sys/debug.h>
  39 #include <sys/atomic.h>
  40 
  41 #include <sys/systm.h>
  42 #include <sys/param.h>
  43 #include <sys/kmem.h>
  44 #include <sys/sdt.h>
  45 #include <sys/socket.h>


 229         if (IN6_IS_ADDR_LINKSCOPE(&dst))
 230                 ifindex = nce->nce_common->ncec_ill->ill_phyint->phyint_ifindex;
 231 
 232         dce = dce_lookup_v6(&dst, ifindex, ipst, NULL);
 233         ASSERT(dce != NULL);
 234 
 235         if (!(ixaflags & IXAF_PMTU_DISCOVERY)) {
 236                 ixa->ixa_fragsize = IPV6_MIN_MTU;
 237         } else if (dce->dce_flags & DCEF_PMTU) {
 238                 /*
 239                  * To avoid a periodic timer to increase the path MTU we
 240                  * look at dce_last_change_time each time we send a packet.
 241                  */
 242                 now = ddi_get_lbolt64();
 243                 if (TICK_TO_SEC(now) - dce->dce_last_change_time >
 244                     ipst->ips_ip_pathmtu_interval) {
 245                         /*
 246                          * Older than 20 minutes. Drop the path MTU information.
 247                          */
 248                         mutex_enter(&dce->dce_lock);
 249                         dce->dce_flags &= ~DCEF_PMTU;
 250                         dce->dce_last_change_time = TICK_TO_SEC(now);
 251                         mutex_exit(&dce->dce_lock);
 252                         dce_increment_generation(dce);
 253                         ixa->ixa_fragsize = ip_get_base_mtu(nce->nce_ill, ire);
 254                 } else {
 255                         uint_t fragsize;
 256 
 257                         fragsize = ip_get_base_mtu(nce->nce_ill, ire);
 258                         if (fragsize > dce->dce_pmtu)
 259                                 fragsize = dce->dce_pmtu;
 260                         ixa->ixa_fragsize = fragsize;
 261                 }
 262         } else {
 263                 ixa->ixa_fragsize = ip_get_base_mtu(nce->nce_ill, ire);
 264         }
 265 
 266         /*
 267          * We use use ire_nexthop_ill (and not ncec_ill) to avoid the under ipmp
 268          * interface for source address selection.
 269          */