Re: sctp ipv6 csum issue

From: Randall Stewart <rrs_at_lakerest.net>
Date: Fri, 12 Mar 2010 12:08:32 +0900
Opps:

I was a little to quick, .. that one won't work.. but I
think this one will (need to have the right magic header
goo :-D)

Try this please (this one will build and actually do something :-D)

R


Index: ip6_output.c
===================================================================
--- ip6_output.c	(revision 205059)
+++ ip6_output.c	(working copy)
_at__at_ -66,6 +66,7 _at__at_
 #include "opt_inet.h"
 #include "opt_inet6.h"
 #include "opt_ipsec.h"
+#include "opt_sctp.h"
 
 #include <sys/param.h>
 #include <sys/kernel.h>
_at__at_ -102,6 +103,10 _at__at_
 #include <netipsec/key.h>
 #include <netinet6/ip6_ipsec.h>
 #endif /* IPSEC */
+#ifdef SCTP
+#include <netinet/sctp.h>
+#include <netinet/sctp_crc32.h>
+#endif
 
 #include <netinet6/ip6protosw.h>
 #include <netinet6/scope6_var.h>
_at__at_ -208,6 +213,9 _at__at_
 	struct route_in6 *ro_pmtu = NULL;
 	int hdrsplit = 0;
 	int needipsec = 0;
+#ifdef SCTP
+	int sw_csum;
+#endif
 #ifdef IPSEC
 	struct ipsec_output_state state;
 	struct ip6_rthdr *rh = NULL;
_at__at_ -829,6 +837,10 _at__at_
 			}
 			m->m_pkthdr.csum_flags |=
 			    CSUM_IP_CHECKED | CSUM_IP_VALID;
+#ifdef SCTP
+			if (m->m_pkthdr.csum_flags & CSUM_SCTP)
+				m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID;
+#endif
 			error = netisr_queue(NETISR_IPV6, m);
 			goto done;
 		} else
_at__at_ -857,6 +869,13 _at__at_
 	 * 4: if dontfrag == 1 && alwaysfrag == 1
 	 *	error, as we cannot handle this conflicting request
 	 */
+#ifdef SCTP
+	sw_csum = m->m_pkthdr.csum_flags & ~ifp->if_hwassist;
+	if (sw_csum & CSUM_SCTP) {
+		sctp_delayed_cksum(m);
+		sw_csum &= ~CSUM_SCTP;
+	}
+#endif
 	tlen = m->m_pkthdr.len;
 
 	if (opt && (opt->ip6po_flags & IP6PO_DONTFRAG))


On Mar 12, 2010, at 11:47 AM, Randall Stewart wrote:

> Nigel:
>
> Here is a patch for your issue I think.
>
> Its off of a head machine but I think it should apply. If not
> let me know.
>
> See if this does not fix the issue.
>
> Thanks
>
> R
> <patch.ip6_output.txt>
> ------------------------------
> Randall Stewart
> 803-317-4952 (cell)
> 803-345-0391(direct)
>
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org 
> "

------------------------------
Randall Stewart
803-317-4952 (cell)
803-345-0391(direct)
Received on Fri Mar 12 2010 - 02:08:44 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:01 UTC