From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.toke.dk (mail.toke.dk [52.28.52.200]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 38EA03CB35 for ; Wed, 22 Aug 2018 05:41:54 -0400 (EDT) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=toke.dk; s=20161023; t=1534930913; bh=pZwz3QP12Q3FVT+vi4hes/2T0Cfhh3xfUv/Y7FNFo1M=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=iGXhTIjcH3fMo33ruxvnv3Wlcgk6eko5MoZSG2HudEYf6hJXR3v3Gk7o0lPdtRgm6 WAKE8qhbqMfoCvXWhuI/YnFmRGpmVBrtlLFIqN5eu7FmmVTzVYFswkRhMTq8RUn420 P+49T9AjUxRm0x1/fCYpyy44HrmaumFaPTJmapUpc+IPTk+chN1ftr+JUrlqCKPeIJ nER8Dekw5qFNpbYffQiWXdo4JTGEGYhIHI57tyb8AE6HU7w0/+7wfiHkIIoDSq+1vV lTc+apDwxMVv0RtClKcq+ny0Ljr0NaN9GzWZm8mHeGmXaOpKgEqqHmMjcuDwRAsEq1 bRm44SxEri7rg== To: Pete Heist Cc: Jonathan Morton , Cake List In-Reply-To: <2689078D-1548-49E7-A9BC-B39980002278@toke.dk> References: <87h8jze5hk.fsf@toke.dk> <85C60B2F-78D0-4AEE-871C-BB637785BF62@gmail.com> <4D28C453-5378-4A5B-9E05-874F36C4DB30@gmail.com> <878t5aedj5.fsf@toke.dk> <87d0uc9d2f.fsf@toke.dk> <2689078D-1548-49E7-A9BC-B39980002278@toke.dk> Date: Wed, 22 Aug 2018 11:41:52 +0200 X-Clacks-Overhead: GNU Terry Pratchett Message-ID: <87r2iq91r3.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Cake] issue with Cake and bpf filter X-BeenThere: cake@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Cake - FQ_codel the next generation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2018 09:41:54 -0000 Toke H=C3=B8iland-J=C3=B8rgensen writes: >>Lastly, if anyone has time to review even just a little code for what >>is or is not good or idiomatic C, post an issue and I=E2=80=99d appreciat= e it. >>Yes, I yield to the =E2=80=98goto=E2=80=99 proponents when it comes to er= ror handling >>and resource de-allocation. :) > > I'll take a look tomorrow :) I can tell from the code that you're coming from Go. But the only thing I found strange on a cursory glance was your error handling method of returning a pointer that is NULL on success. I know this corresponds to "return 0 on success", but, well I was thrown off by the "return NULL" statements in functions indicating success. The usual pattern is to return the error code, and pass in a pointer to the error struct that is only filled if the return code is !=3D 0. This is very much a matter of taste, though, and if you prefer your current style just keep it :) -Toke