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 Assert that we get PRU_ATTACH req...



details:   https://anonhg.NetBSD.org/src/rev/d5618cd839bc
branches:  trunk
changeset: 787091:d5618cd839bc
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sat Jun 01 11:44:37 2013 +0000

description:
Assert that we get PRU_ATTACH requests only for the families we
have registered.

diffstat:

 sys/rump/net/lib/libsockin/sockin.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 24a7305c4d65 -r d5618cd839bc sys/rump/net/lib/libsockin/sockin.c
--- a/sys/rump/net/lib/libsockin/sockin.c       Sat Jun 01 11:02:42 2013 +0000
+++ b/sys/rump/net/lib/libsockin/sockin.c       Sat Jun 01 11:44:37 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sockin.c,v 1.31 2013/06/01 10:10:57 stacktic Exp $     */
+/*     $NetBSD: sockin.c,v 1.32 2013/06/01 11:44:37 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.31 2013/06/01 10:10:57 stacktic Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.32 2013/06/01 11:44:37 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/condvar.h>
@@ -400,6 +400,7 @@
        {
                int news;
                int sbsize;
+               int family;
 
                sosetlock(so);
                if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) {
@@ -408,8 +409,9 @@
                                break;
                }
 
-               error = rumpcomp_sockin_socket(
-                   so->so_proto->pr_domain->dom_family,
+               family = so->so_proto->pr_domain->dom_family;
+               KASSERT(family == PF_INET || family == PF_INET6);
+               error = rumpcomp_sockin_socket(family,
                    so->so_proto->pr_type, 0, &news);
                if (error)
                        break;



Home | Main Index | Thread Index | Old Index