Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Sep 2014 16:30:24 -0700
From:      Adrian Chadd <adrian@freebsd.org>
To:        Garrett Cooper <yaneurabeya@gmail.com>
Cc:        "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, Mateusz Guzik <mjguzik@gmail.com>, "src-committers@freebsd.org" <src-committers@freebsd.org>, Gleb Smirnoff <glebius@freebsd.org>
Subject:   Re: svn commit: r271182 - head/sys/kern
Message-ID:  <CAJ-Vmo=Qc1QH7-6AFyxdEjXgdYYhWJLUBv-7OGanE0q_7AZVRA@mail.gmail.com>
In-Reply-To: <CAJ-Vmok9T_DXH=pPt625xQ2J2qoMYckY6aKyFj8uvBsceHUiwA@mail.gmail.com>
References:  <201409051950.s85JoI3r000416@svn.freebsd.org> <20140905195410.GA722@dft-labs.eu> <FF7C656B-2A15-4355-9821-7D2A29C2AF09@gmail.com> <CAJ-Vmok9T_DXH=pPt625xQ2J2qoMYckY6aKyFj8uvBsceHUiwA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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);

 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmo=Qc1QH7-6AFyxdEjXgdYYhWJLUBv-7OGanE0q_7AZVRA>