Module Name:    src
Committed By:   pooka
Date:           Wed Sep  2 19:04:52 UTC 2009

Modified Files:
        src/sys/rump/net/lib/libsockin: sockin.c

Log Message:
* implement pr_ctloutput
* check for errno before more costly checks


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/rump/net/lib/libsockin/sockin.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libsockin/sockin.c
diff -u src/sys/rump/net/lib/libsockin/sockin.c:1.15 src/sys/rump/net/lib/libsockin/sockin.c:1.16
--- src/sys/rump/net/lib/libsockin/sockin.c:1.15	Wed Mar 18 10:22:45 2009
+++ src/sys/rump/net/lib/libsockin/sockin.c	Wed Sep  2 19:04:51 2009
@@ -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;
 }

Reply via email to