change sosend() to accept sockaddr * instead of mbuf * for nam.

bump to 7.99.16
This commit is contained in:
rtr 2015-05-09 15:22:47 +00:00
parent 6f91147d24
commit d53103fc75
6 changed files with 28 additions and 25 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uipc_socket.c,v 1.244 2015/05/03 04:18:45 rtr Exp $ */
/* $NetBSD: uipc_socket.c,v 1.245 2015/05/09 15:22:47 rtr Exp $ */
/*-
* Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.244 2015/05/03 04:18:45 rtr Exp $");
__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.245 2015/05/09 15:22:47 rtr Exp $");
#include "opt_compat_netbsd.h"
#include "opt_sock_counters.h"
@ -883,8 +883,8 @@ sodisconnect(struct socket *so)
* Data and control buffers are freed on return.
*/
int
sosend(struct socket *so, struct mbuf *addr, struct uio *uio, struct mbuf *top,
struct mbuf *control, int flags, struct lwp *l)
sosend(struct socket *so, struct sockaddr *addr, struct uio *uio,
struct mbuf *top, struct mbuf *control, int flags, struct lwp *l)
{
struct mbuf **mp, *m;
long space, len, resid, clen, mlen;
@ -1059,12 +1059,8 @@ sosend(struct socket *so, struct mbuf *addr, struct uio *uio, struct mbuf *top,
error = (*so->so_proto->pr_usrreqs->pr_sendoob)(so,
top, control);
} else {
struct sockaddr *sin = NULL;
if (addr) {
sin = mtod(addr, struct sockaddr *);
}
error = (*so->so_proto->pr_usrreqs->pr_send)(so,
top, sin, control, l);
top, addr, control, l);
}
if (dontroute)
so->so_options &= ~SO_DONTROUTE;

View File

@ -1,4 +1,4 @@
/* $NetBSD: uipc_syscalls.c,v 1.177 2015/05/02 17:18:03 rtr Exp $ */
/* $NetBSD: uipc_syscalls.c,v 1.178 2015/05/09 15:22:47 rtr Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.177 2015/05/02 17:18:03 rtr Exp $");
__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.178 2015/05/09 15:22:47 rtr Exp $");
#include "opt_pipe.h"
@ -532,6 +532,7 @@ do_sys_sendmsg_so(struct lwp *l, int s, struct socket *so, file_t *fp,
{
struct iovec aiov[UIO_SMALLIOV], *iov = aiov, *tiov, *ktriov = NULL;
struct sockaddr *sa = NULL;
struct mbuf *to, *control;
struct uio auio;
size_t len, iovsz;
@ -611,8 +612,12 @@ do_sys_sendmsg_so(struct lwp *l, int s, struct socket *so, file_t *fp,
if (mp->msg_control)
MCLAIM(control, so->so_mowner);
if (to) {
sa = mtod(to, struct sockaddr *);
}
len = auio.uio_resid;
error = (*so->so_send)(so, to, &auio, NULL, control, flags, l);
error = (*so->so_send)(so, sa, &auio, NULL, control, flags, l);
/* Protocol is responsible for freeing 'control' */
control = NULL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: nfs_boot.c,v 1.83 2015/04/03 20:01:07 rtr Exp $ */
/* $NetBSD: nfs_boot.c,v 1.84 2015/05/09 15:22:47 rtr 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.83 2015/04/03 20:01:07 rtr Exp $");
__KERNEL_RCSID(0, "$NetBSD: nfs_boot.c,v 1.84 2015/05/09 15:22:47 rtr Exp $");
#ifdef _KERNEL_OPT
#include "opt_nfs.h"
@ -468,7 +468,8 @@ send_again:
error = ENOBUFS;
goto out;
}
error = (*so->so_send)(so, nam, NULL, m, NULL, 0, lwp);
error = (*so->so_send)(so, mtod(nam, struct sockaddr *), NULL,
m, NULL, 0, lwp);
if (error) {
printf("nfs_boot: sosend: %d\n", error);
goto out;

View File

@ -1,4 +1,4 @@
/* $NetBSD: nfs_socket.c,v 1.195 2015/05/02 17:18:04 rtr Exp $ */
/* $NetBSD: nfs_socket.c,v 1.196 2015/05/09 15:22:47 rtr Exp $ */
/*
* Copyright (c) 1989, 1991, 1993, 1995
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: nfs_socket.c,v 1.195 2015/05/02 17:18:04 rtr Exp $");
__KERNEL_RCSID(0, "$NetBSD: nfs_socket.c,v 1.196 2015/05/09 15:22:47 rtr Exp $");
#ifdef _KERNEL_OPT
#include "opt_nfs.h"
@ -439,7 +439,7 @@ nfs_safedisconnect(struct nfsmount *nmp)
int
nfs_send(struct socket *so, struct mbuf *nam, struct mbuf *top, struct nfsreq *rep, struct lwp *l)
{
struct mbuf *sendnam;
struct sockaddr *sendnam;
int error, soflags, flags;
/* XXX nfs_doio()/nfs_request() calls with rep->r_lwp == NULL */
@ -463,7 +463,7 @@ nfs_send(struct socket *so, struct mbuf *nam, struct mbuf *top, struct nfsreq *r
if ((soflags & PR_CONNREQUIRED) || (so->so_state & SS_ISCONNECTED))
sendnam = NULL;
else
sendnam = nam;
sendnam = mtod(nam, struct sockaddr *);
if (so->so_type == SOCK_SEQPACKET)
flags = MSG_EOR;
else

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.477 2015/05/02 17:18:04 rtr Exp $ */
/* $NetBSD: param.h,v 1.478 2015/05/09 15:22:47 rtr Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@ -63,7 +63,7 @@
* 2.99.9 (299000900)
*/
#define __NetBSD_Version__ 799001500 /* NetBSD 7.99.15 */
#define __NetBSD_Version__ 799001600 /* NetBSD 7.99.16 */
#define __NetBSD_Prereq__(M,m,p) (((((M) * 100000000) + \
(m) * 1000000) + (p) * 100) <= __NetBSD_Version__)

View File

@ -1,4 +1,4 @@
/* $NetBSD: socketvar.h,v 1.138 2015/05/02 17:18:04 rtr Exp $ */
/* $NetBSD: socketvar.h,v 1.139 2015/05/09 15:22:47 rtr Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@ -127,6 +127,8 @@ struct so_accf {
char *so_accept_filter_str; /* saved user args */
};
struct sockaddr;
struct socket {
kmutex_t * volatile so_lock; /* pointer to lock on structure */
kcondvar_t so_cv; /* notifier */
@ -167,7 +169,7 @@ struct socket {
void *so_internal; /* Space for svr4 stream data */
void (*so_upcall) (struct socket *, void *, int, int);
void * so_upcallarg; /* Arg for above */
int (*so_send) (struct socket *, struct mbuf *,
int (*so_send) (struct socket *, struct sockaddr *,
struct uio *, struct mbuf *,
struct mbuf *, int, struct lwp *);
int (*so_receive) (struct socket *,
@ -241,7 +243,6 @@ extern int sock_loan_thresh;
extern kmutex_t *softnet_lock;
struct mbuf;
struct sockaddr;
struct lwp;
struct msghdr;
struct stat;
@ -315,7 +316,7 @@ int soreceive(struct socket *, struct mbuf **, struct uio *,
struct mbuf **, struct mbuf **, int *);
int soreserve(struct socket *, u_long, u_long);
void sorflush(struct socket *);
int sosend(struct socket *, struct mbuf *, struct uio *,
int sosend(struct socket *, struct sockaddr *, struct uio *,
struct mbuf *, struct mbuf *, int, struct lwp *);
int sosetopt(struct socket *, struct sockopt *);
int so_setsockopt(struct lwp *, struct socket *, int, int, const void *, size_t);