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 * implement pr_ctloutput



details:   https://anonhg.NetBSD.org/src/rev/1f6f2a8fce0b
branches:  trunk
changeset: 747112:1f6f2a8fce0b
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Sep 02 19:04:51 2009 +0000

description:
* implement pr_ctloutput
* check for errno before more costly checks

diffstat:

 sys/rump/net/lib/libsockin/sockin.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (39 lines):

diff -r 2c789ea7e5d8 -r 1f6f2a8fce0b sys/rump/net/lib/libsockin/sockin.c
--- a/sys/rump/net/lib/libsockin/sockin.c       Wed Sep 02 19:02:51 2009 +0000
+++ b/sys/rump/net/lib/libsockin/sockin.c       Wed Sep 02 19:04:51 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sockin.c,v 1.15 2009/03/18 10:22:45 cegger Exp $       */
+/*     $NetBSD: sockin.c,v 1.16 2009/09/02 19:04:51 pooka 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.15 2009/03/18 10:22:45 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.16 2009/09/02 19:04:51 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/condvar.h>
@@ -197,7 +197,7 @@
                m_freem(m);
 
                /* Treat a TCP socket a goner */
-               if (so->so_proto->pr_type == SOCK_STREAM && error != EAGAIN) {
+               if (error != EAGAIN && so->so_proto->pr_type == SOCK_STREAM) {
                        mutex_enter(softnet_lock);
                        soisdisconnected(so);
                        mutex_exit(softnet_lock);
@@ -464,7 +464,9 @@
 static int
 sockin_ctloutput(int op, struct socket *so, struct sockopt *sopt)
 {
+       int error;
 
-       /* XXX: we should also do something here */
-       return 0;
+       rumpuser_net_setsockopt(SO2S(so), sopt->sopt_level,
+           sopt->sopt_name, sopt->sopt_data, sopt->sopt_size, &error);
+       return error;
 }



Home | Main Index | Thread Index | Old Index