Author: bz
Date: Tue Feb 25 15:03:41 2020
New Revision: 358311
URL: https://svnweb.freebsd.org/changeset/base/358311

Log:
  ip6_output: fix regression introduced in r358167 for ipv6 fragmentation
  
  When moving the calculations for the optlen into the if (opt) block
  which deals with possible extension headers I failed to initialise
  unfragpartlen to the ipv6 header length if there were no extension
  headers present.  Correct that mistake to make IPv6 fragment length
  calculcations work again.
  
  Reported by:  hselasky, kp
  OKed by:      hselasky, kp
  MFC after:    3 days
  X-MFC with:   r358167
  PR:           244393

Modified:
  head/sys/netinet6/ip6_output.c

Modified: head/sys/netinet6/ip6_output.c
==============================================================================
--- head/sys/netinet6/ip6_output.c      Tue Feb 25 12:56:06 2020        
(r358310)
+++ head/sys/netinet6/ip6_output.c      Tue Feb 25 15:03:41 2020        
(r358311)
@@ -497,7 +497,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
         */
        bzero(&exthdrs, sizeof(exthdrs));
        optlen = 0;
-       unfragpartlen = 0;
+       unfragpartlen = sizeof(struct ip6_hdr);
        if (opt) {
                /* Hop-by-Hop options header. */
                MAKE_EXTHDR(opt->ip6po_hbh, &exthdrs.ip6e_hbh, optlen);
@@ -535,7 +535,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
                /* Routing header. */
                MAKE_EXTHDR(opt->ip6po_rthdr, &exthdrs.ip6e_rthdr, optlen);
 
-               unfragpartlen = optlen + sizeof(struct ip6_hdr);
+               unfragpartlen += optlen;
 
                /*
                 * NOTE: we don't add AH/ESP length here (done in
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to