Module Name:    src
Committed By:   maxv
Date:           Mon Jan 22 06:56:25 UTC 2018

Modified Files:
        src/sys/netinet: ip_icmp.c

Log Message:
Adapt previous, reintroduce MH_ALIGN. It's used as an optimization - we
can later prepend something to the current mbuf without having to allocate
a new mbuf.


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/sys/netinet/ip_icmp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet/ip_icmp.c
diff -u src/sys/netinet/ip_icmp.c:1.163 src/sys/netinet/ip_icmp.c:1.164
--- src/sys/netinet/ip_icmp.c:1.163	Fri Jan 19 13:17:29 2018
+++ src/sys/netinet/ip_icmp.c	Mon Jan 22 06:56:25 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_icmp.c,v 1.163 2018/01/19 13:17:29 maxv Exp $	*/
+/*	$NetBSD: ip_icmp.c,v 1.164 2018/01/22 06:56:25 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -94,7 +94,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.163 2018/01/19 13:17:29 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.164 2018/01/22 06:56:25 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ipsec.h"
@@ -345,6 +345,9 @@ icmp_error(struct mbuf *n, int type, int
 		panic("icmp_error");
 	ICMP_STATINC(ICMP_STAT_OUTHIST + type);
 
+	if ((m->m_flags & M_EXT) == 0)
+		MH_ALIGN(m, m->m_len);
+
 	/*
 	 * Get pointers on the IP header and the ICMP header.
 	 */

Reply via email to