From owner-freebsd-net@freebsd.org Tue Apr 12 13:45:51 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3BB2B0D9C1 for ; Tue, 12 Apr 2016 13:45:51 +0000 (UTC) (envelope-from marieheleneka@gmail.com) Received: from mail-lf0-x22b.google.com (mail-lf0-x22b.google.com [IPv6:2a00:1450:4010:c07::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A1001347 for ; Tue, 12 Apr 2016 13:45:51 +0000 (UTC) (envelope-from marieheleneka@gmail.com) Received: by mail-lf0-x22b.google.com with SMTP id e190so26002083lfe.0 for ; Tue, 12 Apr 2016 06:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=9ummW+OovOPZgxkoF+nCalhkk54+NSXF893nFja4Gbs=; b=tj01SKnrr4F3PI0VtQbVEH/ILvc5QWpaCoRu0RQFn6IfVBK7Tlt+7PsTG4uRjYUqlT wOdFpuB32/C/RtcRQu361CufPMf66qd7hZ739zaJoTcrRgbU7YTlKvVGsuRjydNF4Aga WfqU3CZQVVh5KJJY0JXkphjgTVp5SQvJFlKzYAQ2uWmckPHhXJV7eznY6hxoMScBav3X uwdRp6Nj+ekJpSSeszejKl24RUhlwkDKOo6kWgHtS/3iI9zkpOOZ7kPfxl8EOGy5qEx7 QVU6reaTZzigBLgxaAK+j8qicQMw5GnM3mOIDnCkw93OOeFMVxx1yNVbuNgSEclqTb6M cz3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=9ummW+OovOPZgxkoF+nCalhkk54+NSXF893nFja4Gbs=; b=CnkPOUHyc9JP2V+ECW1biWsHru0L4wuVdkQZuFKvlpkfv1omdN3dcIxGAM8AR+/Gzn p72HTy+8EErLQ9+KjmJKcRimnxq+3hrsm7Z5RwzLAbYrE0Hk6i6ZOFhT5u/WPaDIdrnw vHlv8Kz5FD6b3QVjXxdHCX3HUr6MBolbyVr3feBzt18J3FA413HFkkAnz0M08ctx36PY mztJxyBHB+P+N8z9xeSWZSURFBYVgsO9owB4cu2jOpDEbrHk7WvT8XuWwfB7dL1pc4rX s7OofSHbpc3gBl0UF0W/XIIZLaAHFvYAzLVeKhl7yXUta5zk8ZUJ3bUijJ3UxOLmmskm e2ww== X-Gm-Message-State: AOPr4FV0N3OcNOQqcVJfEOnElspwgw4ycrzeAxKOjyUkPr6W72XTjMtYNQtvGDst7Sav3V/8JTsjqhsw8gD9LQ== X-Received: by 10.112.151.207 with SMTP id us15mr1225664lbb.28.1460468749410; Tue, 12 Apr 2016 06:45:49 -0700 (PDT) MIME-Version: 1.0 References: <25165EFB-4D17-476D-86C6-D99C3E97F227@panasas.com> In-Reply-To: <25165EFB-4D17-476D-86C6-D99C3E97F227@panasas.com> From: Marie Helene Kvello-Aune Date: Tue, 12 Apr 2016 13:45:39 +0000 Message-ID: Subject: Re: libifconfig: Initial code available, looking for feedback To: Ravi Pokala , "freebsd-net@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 13:45:51 -0000 On Mon, Apr 11, 2016 at 8:42 AM Ravi Pokala wrote: > -----Original Message----- > > > >Date: Sat, 09 Apr 2016 13:59:29 +0000 > >From: Marie Helene Kvello-Aune > >To: freebsd-net@freebsd.org > >Subject: libifconfig: Initial code available, looking for feedback > >Message-ID: > > j-eVVJQQ@mail.gmail.com> > >Content-Type: text/plain; charset=UTF-8 > > > >Hey! > > > >Please see previous thread[1] for context on what libifconfig is. > > > >I've just pushed an initial version of libifconfig to the github > >repository[2]. I would appreciate feedback, in particular on the API > design > >and usage, and especially on how it communicates error state to the > >application. > > Hi, > > I'm definitely not a networking person, but I have some comments: > > Thanks for the feedback! I've made note of all of it, even though I'm not commenting on all of it. :) > libifconfig.h > > #pragma once - I'm not sure if that's supported in every compiler used > in the base system; I'd stick with a traditional guard macro. > > I did research this some, and came to the conclusion it's supported. But I'll take another look at it. > libifconfig_ioctlwrap() / libifconfig_ioctlwrap_caddr() - it's not > clear why you're using one versus the other. > > I'm basically reusing ifconfig code where I can, and the ifconfig code has some places where it casts to caddr_t and some places it doesn't. I haven't researched whether casting is necessary yet, and therefore I'm mimicking the original code as closely as I can, to be on the safe side. If it turns out it's unnecessary, it should be a simple task to clean it up. :) > libifconfig_get_description() - the case of the ioctl failing is not > handled. > Good catch. This code was fine in ifconfig because the later break statement ends the loop, but this is not sufficient for libifconfig. :) libifconfig_socketcache.c > > libifconfig_socket() - similar to libifconfig_ioctlwrap_ret(), the > value of "errno" is lost. > > It looks like I'll have to restructure the errstate struct a bit and make it clear it's a stored errno. But at that point it may be pointless to store it there, as 'errno' is thread safe, and the calling application can access that directly. [1] Issue 1: https://github.com/Savagedlight/libifconfig/issues/1 Thanks! -- Marie Helene Kvello-Aune marieheleneka@gmail.com > Thanks, > > Ravi (rpokala@) > > _______________________________________________ > freebsd-net@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >