From owner-freebsd-net@FreeBSD.ORG Mon Jan 14 21:58:00 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6A46F521; Mon, 14 Jan 2013 21:58:00 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 2DD4BDF5; Mon, 14 Jan 2013 21:58:00 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 99A1EB945; Mon, 14 Jan 2013 16:57:59 -0500 (EST) From: John Baldwin To: freebsd-net@freebsd.org Subject: Re: [PATCH] Don't imply TCP and UDP socket options are bitmasks Date: Mon, 14 Jan 2013 16:56:36 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201301141550.13577.jhb@freebsd.org> <50F47BB8.9000409@mu.org> In-Reply-To: <50F47BB8.9000409@mu.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201301141656.37175.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 14 Jan 2013 16:57:59 -0500 (EST) Cc: Alfred Perlstein , net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jan 2013 21:58:00 -0000 On Monday, January 14, 2013 4:42:16 pm Alfred Perlstein wrote: > Wouldn't a comment over the code suffice? > > Something like your email as a header would actually work very nicely! > > I think just using decimal would be more confusing than explicitly > calling it out like: > > /* begin enumerated (not bitmask) socket option specifiers */ > #define TCP_MAXSEG 0x02 /* set maximum segment size */ > #define TCP_NOPUSH 0x04 /* don't push last block of write */ > #define TCP_NOOPT 0x08 /* don't use TCP options */ > #define TCP_MD5SIG 0x10 /* use MD5 digests (RFC2385) */ > /* end enumerated socket option specifiers */ I have a patch I'll post next which will add a new option as '3'. I think that will make it more obvious and avoid having new options follow the old pattern. -- John Baldwin