Patch for fragment problem in key.c

George V. Neville-Neil gnn at neville-neil.com
Mon Sep 27 18:39:41 PDT 2004


Hi Folks,

	Robert Watson tried to send email about this but it never got
	through, and then Sam Leffler got ahold of me and told me he
	fixed something similar in the FAST_IPSEC code.  So, the
	following patch fixes, in KAME IPSec.  This patch was
	generated against 6.0-CURRENT and I included Sam's commit
	message.

Later,
George

Correct handling of SADB_UPDATE and SADB_ADD requests.  key_align may split
the mbuf due to use of m_pulldown.  Discarding the result because of this
does not make sense as no subsequent code depends on the entire msg being
linearized (only the individual pieces).  It's likely something else is wrong
here but for now this appears to get things back to a working state.

Index: sys/netkey/key.c
===================================================================
RCS file: /Volumes/exported/FreeBSD-CVS/src/sys/netkey/key.c,v
retrieving revision 1.67
diff -u -r1.67 key.c
--- sys/netkey/key.c	2 Sep 2004 20:14:03 -0000	1.67
+++ sys/netkey/key.c	27 Sep 2004 16:08:31 -0000
@@ -6952,11 +6952,6 @@
 	if (error)
 		return error;
 
-	if (m->m_next) {	/*XXX*/
-		m_freem(m);
-		return ENOBUFS;
-	}
-
 	msg = mh.msg;
 
 	/* check SA type */


More information about the freebsd-net mailing list