Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/rump/net/lib/libsockin * split PRU_SENSE functionality o...



details:   https://anonhg.NetBSD.org/src/rev/ee1a90fa4fad
branches:  trunk
changeset: 330372:ee1a90fa4fad
user:      rtr <rtr%NetBSD.org@localhost>
date:      Sun Jul 06 16:18:46 2014 +0000

description:
* split PRU_SENSE functionality out of sockin_usrreq() and place into
  separate sockin_stat(struct socket *, struct stat *) function.
* change behavior of function to just return success (like pretty much
  every other implementation) instead of panic()ing due to lack of
  implementation.

diffstat:

 sys/rump/net/lib/libsockin/sockin.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (54 lines):

diff -r d36a0a1d85a9 -r ee1a90fa4fad sys/rump/net/lib/libsockin/sockin.c
--- a/sys/rump/net/lib/libsockin/sockin.c       Sun Jul 06 16:06:19 2014 +0000
+++ b/sys/rump/net/lib/libsockin/sockin.c       Sun Jul 06 16:18:46 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sockin.c,v 1.42 2014/07/01 05:49:19 rtr Exp $  */
+/*     $NetBSD: sockin.c,v 1.43 2014/07/06 16:18:46 rtr Exp $  */
 
 /*
  * Copyright (c) 2008, 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.42 2014/07/01 05:49:19 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.43 2014/07/06 16:18:46 rtr Exp $");
 
 #include <sys/param.h>
 #include <sys/condvar.h>
@@ -69,6 +69,7 @@
 static int     sockin_attach(struct socket *, int);
 static void    sockin_detach(struct socket *);
 static int     sockin_ioctl(struct socket *, u_long, void *, struct ifnet *);
+static int     sockin_stat(struct socket *, struct stat *);
 static int     sockin_usrreq(struct socket *, int, struct mbuf *,
                              struct mbuf *, struct mbuf *, struct lwp *);
 static int     sockin_ctloutput(int op, struct socket *, struct sockopt *);
@@ -77,6 +78,7 @@
        .pr_attach = sockin_attach,
        .pr_detach = sockin_detach,
        .pr_ioctl = sockin_ioctl,
+       .pr_stat = sockin_stat,
        .pr_generic = sockin_usrreq,
 };
 
@@ -458,12 +460,19 @@
 }
 
 static int
+sockin_stat(struct socket *so, struct stat *ub)
+{
+       return 0;
+}
+
+static int
 sockin_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
        struct mbuf *control, struct lwp *l)
 {
        int error = 0;
 
        KASSERT(req != PRU_CONTROL);
+       KASSERT(req != PRU_SENSE);
 
        switch (req) {
        case PRU_ACCEPT:



Home | Main Index | Thread Index | Old Index