Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src/sys Pull up following revision(s) (requested by hikaru in...
details: https://anonhg.NetBSD.org/src/rev/3bb4e84d6c9e
branches: netbsd-6
changeset: 776951:3bb4e84d6c9e
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Thu Apr 16 09:34:04 2015 +0000
description:
Pull up following revision(s) (requested by hikaru in ticket #1287):
sys/kern/subr_tftproot.c: revision 1.14 via patch
sys/nfs/nfsdiskless.h: revision 1.31
sys/nfs/nfs_boot.c: revision 1.82
sys/nfs/krpc_subr.c: revision 1.39
sys/nfs/nfs_bootdhcp.c: revision 1.53
m_pullup() is called in rcvproc callback functions,
so nfs_boot_sendrecv() should keep track of the head of mbuf chain.
fixes kern/48746
diffstat:
sys/kern/subr_tftproot.c | 11 ++++++-----
sys/nfs/krpc_subr.c | 11 ++++++-----
sys/nfs/nfs_boot.c | 8 ++++----
sys/nfs/nfs_bootdhcp.c | 11 ++++++-----
sys/nfs/nfsdiskless.h | 4 ++--
5 files changed, 24 insertions(+), 21 deletions(-)
diffs (198 lines):
diff -r 34febfc198db -r 3bb4e84d6c9e sys/kern/subr_tftproot.c
--- a/sys/kern/subr_tftproot.c Thu Apr 16 09:27:32 2015 +0000
+++ b/sys/kern/subr_tftproot.c Thu Apr 16 09:34:04 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_tftproot.c,v 1.10 2009/08/23 12:10:50 manu Exp $ */
+/* $NetBSD: subr_tftproot.c,v 1.10.18.1 2015/04/16 09:34:04 msaitoh Exp $ */
/*-
* Copyright (c) 2007 Emmanuel Dreyfus, all rights reserved.
@@ -39,7 +39,7 @@
#include "opt_md.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_tftproot.c,v 1.10 2009/08/23 12:10:50 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_tftproot.c,v 1.10.18.1 2015/04/16 09:34:04 msaitoh Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -117,7 +117,7 @@
int tftproot_dhcpboot(struct device *);
static int tftproot_getfile(struct tftproot_handle *, struct lwp *);
-static int tftproot_recv(struct mbuf*, void*);
+static int tftproot_recv(struct mbuf **, void *);
int
tftproot_dhcpboot(struct device *bootdv)
@@ -350,10 +350,11 @@
}
static int
-tftproot_recv(struct mbuf *m, void *ctx)
+tftproot_recv(struct mbuf **mp, void *ctx)
{
struct tftproot_handle *trh = ctx;
struct tftphdr *tftp;
+ struct mbuf *m = *mp;
size_t newlen;
size_t hdrlen = sizeof(*tftp) - sizeof(tftp->th_data);
@@ -380,7 +381,7 @@
* Examine the TFTP header
*/
if (m->m_len > sizeof(*tftp)) {
- if ((m = m_pullup(m, sizeof(*tftp))) == NULL) {
+ if ((m = *mp = m_pullup(m, sizeof(*tftp))) == NULL) {
DPRINTF(("%s():%d m_pullup failed\n",
__func__, __LINE__));
return -1;
diff -r 34febfc198db -r 3bb4e84d6c9e sys/nfs/krpc_subr.c
--- a/sys/nfs/krpc_subr.c Thu Apr 16 09:27:32 2015 +0000
+++ b/sys/nfs/krpc_subr.c Thu Apr 16 09:34:04 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: krpc_subr.c,v 1.37 2009/03/15 17:20:09 cegger Exp $ */
+/* $NetBSD: krpc_subr.c,v 1.37.18.1 2015/04/16 09:34:04 msaitoh Exp $ */
/*
* Copyright (c) 1995 Gordon Ross, Adam Glass
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: krpc_subr.c,v 1.37 2009/03/15 17:20:09 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: krpc_subr.c,v 1.37.18.1 2015/04/16 09:34:04 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -124,7 +124,7 @@
#define MIN_REPLY_HDR 16 /* xid, dir, astat, errno */
-static int krpccheck(struct mbuf*, void*);
+static int krpccheck(struct mbuf**, void*);
/*
* Call portmap to lookup a port number for a particular rpc program
@@ -183,15 +183,16 @@
return 0;
}
-static int krpccheck(struct mbuf *m, void *context)
+static int krpccheck(struct mbuf **mp, void *context)
{
struct rpc_reply *reply;
+ struct mbuf *m = *mp;
/* Does the reply contain at least a header? */
if (m->m_pkthdr.len < MIN_REPLY_HDR)
return(-1);
if (m->m_len < sizeof(struct rpc_reply)) {
- m = m_pullup(m, sizeof(struct rpc_reply));
+ m = *mp = m_pullup(m, sizeof(struct rpc_reply));
if (m == NULL)
return(-1);
}
diff -r 34febfc198db -r 3bb4e84d6c9e sys/nfs/nfs_boot.c
--- a/sys/nfs/nfs_boot.c Thu Apr 16 09:27:32 2015 +0000
+++ b/sys/nfs/nfs_boot.c Thu Apr 16 09:34:04 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs_boot.c,v 1.80 2010/10/04 23:48:22 cyber Exp $ */
+/* $NetBSD: nfs_boot.c,v 1.80.14.1 2015/04/16 09:34:04 msaitoh Exp $ */
/*-
* Copyright (c) 1995, 1997 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_boot.c,v 1.80 2010/10/04 23:48:22 cyber Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_boot.c,v 1.80.14.1 2015/04/16 09:34:04 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_nfs.h"
@@ -432,7 +432,7 @@
nfs_boot_sendrecv(struct socket *so, struct mbuf *nam,
int (*sndproc)(struct mbuf *, void *, int),
struct mbuf *snd,
- int (*rcvproc)(struct mbuf *, void *),
+ int (*rcvproc)(struct mbuf **, void *),
struct mbuf **rcv, struct mbuf **from_p,
void *context, struct lwp *lwp)
{
@@ -510,7 +510,7 @@
panic("nfs_boot_sendrecv: return size");
#endif
- if ((*rcvproc)(m, context))
+ if ((*rcvproc)(&m, context))
continue;
if (rcv)
diff -r 34febfc198db -r 3bb4e84d6c9e sys/nfs/nfs_bootdhcp.c
--- a/sys/nfs/nfs_bootdhcp.c Thu Apr 16 09:27:32 2015 +0000
+++ b/sys/nfs/nfs_bootdhcp.c Thu Apr 16 09:34:04 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs_bootdhcp.c,v 1.52 2010/10/04 23:48:22 cyber Exp $ */
+/* $NetBSD: nfs_bootdhcp.c,v 1.52.14.1 2015/04/16 09:34:04 msaitoh Exp $ */
/*-
* Copyright (c) 1995, 1997 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_bootdhcp.c,v 1.52 2010/10/04 23:48:22 cyber Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_bootdhcp.c,v 1.52.14.1 2015/04/16 09:34:04 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_nfs_boot.h"
@@ -302,7 +302,7 @@
};
static int bootpset (struct mbuf*, void*, int);
-static int bootpcheck (struct mbuf*, void*);
+static int bootpcheck (struct mbuf**, void*);
static int
bootpset(struct mbuf *m, void *context, int waited)
@@ -318,10 +318,11 @@
}
static int
-bootpcheck(struct mbuf *m, void *context)
+bootpcheck(struct mbuf **mp, void *context)
{
struct bootp *bootp;
struct bootpcontext *bpc = context;
+ struct mbuf *m = *mp;
u_int tag, len;
u_char *p, *limit;
@@ -343,7 +344,7 @@
* don't make first checks more expensive than necessary
*/
if (m->m_len < offsetof(struct bootp, bp_sname)) {
- m = m_pullup(m, offsetof(struct bootp, bp_sname));
+ m = *mp = m_pullup(m, offsetof(struct bootp, bp_sname));
if (m == NULL) {
DPRINTF(("bootpcheck: m_pullup failed\n"));
return (-1);
diff -r 34febfc198db -r 3bb4e84d6c9e sys/nfs/nfsdiskless.h
--- a/sys/nfs/nfsdiskless.h Thu Apr 16 09:27:32 2015 +0000
+++ b/sys/nfs/nfsdiskless.h Thu Apr 16 09:34:04 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nfsdiskless.h,v 1.30 2010/10/04 23:48:23 cyber Exp $ */
+/* $NetBSD: nfsdiskless.h,v 1.30.14.1 2015/04/16 09:34:04 msaitoh Exp $ */
/*-
* Copyright (c) 1995, 1997 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
int nfs_boot_sobind_ipport (struct socket *, uint16_t, struct lwp *);
int nfs_boot_sendrecv (struct socket *, struct mbuf *,
int (*)(struct mbuf*, void*, int), struct mbuf*,
- int (*)(struct mbuf*, void*), struct mbuf**,
+ int (*)(struct mbuf**, void*), struct mbuf**,
struct mbuf**, void*, struct lwp *);
int nfs_bootdhcp (struct nfs_diskless *, struct lwp *, int *);
Home |
Main Index |
Thread Index |
Old Index