From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 23:30:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A1D5494; Fri, 5 Sep 2014 23:30:26 +0000 (UTC) Received: from mail-qg0-x236.google.com (mail-qg0-x236.google.com [IPv6:2607:f8b0:400d:c04::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DACE01E69; Fri, 5 Sep 2014 23:30:25 +0000 (UTC) Received: by mail-qg0-f54.google.com with SMTP id q108so5202730qgd.41 for ; Fri, 05 Sep 2014 16:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=+LBI1b7P+DbOISbCuANyPfyqhgnzrbbAGawtISn9hSg=; b=f7+c3/AeDZrSR81vTBMGfEnXA0vkemX0KvlJNMDHDfHlC6L0/MJcOnb0O2qk4ibDCc z+jkRSjXXOHW35n22hEIyWunJbmYHNxaCKIprU9HPrE+avYmar51bz+VPeoeYZHEmcG1 Cy844BYaUOrH0noK17tB4FcW9nQiZCNahSdcWdoH07WqxB3zxnXWH3N/eHzknQk3IPQt alwrdJpB+iAgRwt1wGYKm2FzrPM9zyeMCvn3okNYQ7i2U95I2t85szOxKYAHak7E1x2/ e8ww0lTq6EpjmNn84q3/fO+6XmwkmbyLf4pOjfHp6cU4RQvjutbIdby9kpJKM3t9vwxF mrxw== MIME-Version: 1.0 X-Received: by 10.224.151.69 with SMTP id b5mr23562606qaw.37.1409959824710; Fri, 05 Sep 2014 16:30:24 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.39.139 with HTTP; Fri, 5 Sep 2014 16:30:24 -0700 (PDT) In-Reply-To: References: <201409051950.s85JoI3r000416@svn.freebsd.org> <20140905195410.GA722@dft-labs.eu> Date: Fri, 5 Sep 2014 16:30:24 -0700 X-Google-Sender-Auth: 1slcYaK-PkLvHcLHi_e7zdopuyE Message-ID: Subject: Re: svn commit: r271182 - head/sys/kern From: Adrian Chadd To: Garrett Cooper Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Mateusz Guzik , "src-committers@freebsd.org" , Gleb Smirnoff X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 23:30:26 -0000 How's this look? adrian@testbox1:~/work/freebsd/head/src % svnlite diff sys/kern/ Index: sys/kern/uipc_socket.c =================================================================== --- sys/kern/uipc_socket.c (revision 271182) +++ sys/kern/uipc_socket.c (working copy) @@ -448,10 +448,12 @@ mac_socket_destroy(so); #endif CURVNET_SET(so->so_vnet); - if (V_socket_hhh[HHOOK_SOCKET_CLOSE]->hhh_nhooks > 0) + if (V_socket_hhh[HHOOK_SOCKET_CLOSE]->hhh_nhooks > 0) { hhook_run_socket(so, NULL, HHOOK_SOCKET_CLOSE); - CURVNET_RESTORE(); - + CURVNET_RESTORE(); + } else { + CURVNET_RESTORE(); + } crfree(so->so_cred); khelp_destroy_osd(&so->osd); sx_destroy(&so->so_snd.sb_sx); @@ -3245,6 +3247,7 @@ filt_soread(struct knote *kn, long hint) { struct socket *so; + int ret; so = kn->kn_fp->f_data; SOCKBUF_LOCK_ASSERT(&so->so_rcv); @@ -3266,11 +3269,15 @@ } CURVNET_SET(so->so_vnet); - if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0) + if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0) { /* This hook returning non-zero indicates an event, not error */ - return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD)); - CURVNET_RESTORE(); - + ret = (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD)); + CURVNET_RESTORE(); + return (ret); + } else { + CURVNET_RESTORE(); + } + return (0); }