Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/sys/net Pull up following revision(s) (reque...
details: https://anonhg.NetBSD.org/src/rev/138165eb1e57
branches: netbsd-8
changeset: 319117:138165eb1e57
user: martin <martin%NetBSD.org@localhost>
date: Thu May 17 14:02:31 2018 +0000
description:
Pull up following revision(s) (requested by knakahara in ticket #828):
sys/net/if_ipsec.c: revision 1.12
Fix "how" argument of MGET(). Pointed out by maxv@n.o, thanks.
MGET() does not have M_ZERO flag, so add memset when it is required.
diffstat:
sys/net/if_ipsec.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diffs (62 lines):
diff -r c36366310156 -r 138165eb1e57 sys/net/if_ipsec.c
--- a/sys/net/if_ipsec.c Thu May 17 13:58:07 2018 +0000
+++ b/sys/net/if_ipsec.c Thu May 17 14:02:31 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ipsec.c,v 1.3.2.5 2018/04/09 17:01:20 martin Exp $ */
+/* $NetBSD: if_ipsec.c,v 1.3.2.6 2018/05/17 14:02:31 martin Exp $ */
/*
* Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ipsec.c,v 1.3.2.5 2018/04/09 17:01:20 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ipsec.c,v 1.3.2.6 2018/05/17 14:02:31 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -1339,10 +1339,11 @@
{
struct mbuf *m;
- MGET(m, M_WAITOK | M_ZERO, MT_DATA);
- if (align)
+ MGET(m, M_WAIT, MT_DATA);
+ if (align) {
m->m_len = PFKEY_ALIGN8(len);
- else
+ memset(mtod(m, void *), 0, m->m_len);
+ } else
m->m_len = len;
m_copyback(m, 0, len, data);
m_cat(m0, m);
@@ -1378,8 +1379,9 @@
if (len == 0)
return;
- MGET(m, M_WAITOK | M_ZERO, MT_DATA);
+ MGET(m, M_WAIT, MT_DATA);
m->m_len = len;
+ memset(mtod(m, void *), 0, m->m_len);
m_cat(m0, m);
}
@@ -1556,7 +1558,7 @@
memset(&xpl, 0, sizeof(xpl));
memset(&xisr, 0, sizeof(xisr));
- MGETHDR(m, M_WAITOK, MT_DATA);
+ MGETHDR(m, M_WAIT, MT_DATA);
size = if_ipsec_set_sadb_src(&xsrc, src, proto);
ext_msg_len += PFKEY_UNIT64(size);
@@ -1683,7 +1685,7 @@
memset(&msg, 0, sizeof(msg));
memset(&xpl, 0, sizeof(xpl));
- MGETHDR(m, M_WAITOK, MT_DATA);
+ MGETHDR(m, M_WAIT, MT_DATA);
size = if_ipsec_set_sadb_x_policy(&xpl, NULL, 0, 0, sp->id, 0, NULL, NULL);
ext_msg_len += PFKEY_UNIT64(size);
Home |
Main Index |
Thread Index |
Old Index