Date: Mon, 31 Jan 2011 14:52:09 +0200 From: Ivo Vachkov <ivo.vachkov@gmail.com> To: Doug Barton <dougb@freebsd.org> Cc: FreeBSD Net <freebsd-net@freebsd.org>, bz@freebsd.org Subject: Re: Proposed patch for Port Randomization modifications according to RFC6056 Message-ID: <AANLkTim4=xa0rfoLgt-ao30XoZkLZ1hMYzE6LsrLNcbM@mail.gmail.com> In-Reply-To: <4D437B13.1070405@FreeBSD.org> References: <AANLkTi=rF%2BCYiNG7PurPtrwn-AMT9cYEe90epGAJDwDq@mail.gmail.com> <4D411CC6.1090202@gont.com.ar> <AANLkTinvg5tft8xockuuV9g5QYd36ko9qO4YCvy5bkJ1@mail.gmail.com> <4D431258.8040704@FreeBSD.org> <AANLkTimhZ_pxTGt958AX8m=%2BS=g2hqsst=GH1a99D0g1@mail.gmail.com> <4D437B13.1070405@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--00163646d5be7d227c049b23e38f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, I attach the latest version of the port randomization code as a patch against RELENG_8. Changelog: 1) sysctl variable names are changed to: - 'net.inet.ip.portrange.randomalg.version' - representing the algorithm of choice. - 'net.inet.ip.portrange.randomalg.alg5_tradeoff' - representing the Algorithm 5 computational tradeoff value (the 'N' value in the Algorithm 5 description in the RFC 6056). 2) Code comments are synchronized with the current variable names. Ivo Vachkov On Sat, Jan 29, 2011 at 4:27 AM, Doug Barton <dougb@freebsd.org> wrote: > On 01/28/2011 11:57, Ivo Vachkov wrote: >> >> On Fri, Jan 28, 2011 at 9:00 PM, Doug Barton<dougb@freebsd.org> =C2=A0wr= ote: > >>> How does net.inet.ip.portrange.randomalg sound? I would also suggest th= at >>> the second sysctl be named net.inet.ip.portrange.randomalg.alg5_tradeof= f >>> so >>> that one could do 'sysctl net.inet.ip.portrange.randomalg' and see both >>> values. But I won't quibble on that. :) >>> >> >> I have no objections with this. Since this is my first attempt to >> contribute something back to the community I decided to see how it's >> done before. So I found: >> net.inet.tcp.rfc1323 >> net.inet.tcp.rfc3465 >> net.inet.tcp.rfc3390 >> net.inet.tcp.rfc3042 >> which probably led me in a wrong direction :) > > Yeah, I had actually intended to say something to the effect of "there ar= e > plenty of unfortunate examples in the tree already so your doing it that = way > is totally understandable" but I trimmed it. > >> I understand your point and agree with it. However, my somewhat >> limited understanding of the sysctl internal organization is telling >> me that tree node does not support values. Am I wrong? > > You are likely correct. :) =C2=A0It's an inconvenient fact that often for= get > because that's not the sandbox that I usually play in. > >> If my reasoning >> is correct, maybe I can create the sysctl variables with the following >> names: >> - net.inet.ip.portrange.randomalg (Tree Node) >> - net.inet.ip.portrange.randomalg.alg[orithm] (Leaf Node, to store the >> selected algorithm) > > I would go with "version" to increase the visual distinctiveness. I searc= hed > the current tree and there doesn't seem to be a clear winner for how to > portray "this is the current N/M that is in use" but "version" seems to h= ave > the most representatives. > >> - net.inet.ip.portrange.randomalg.alg5_tradeoff (Leaf Node, to store >> the Algorithm 5 trade-off value) > > I'm assuming this is the "N" value mentioned in the RFC. If so, I commend > you on your choice of "tradeoff" to represent it. :) > > > hth, > > Doug > > -- > > =C2=A0 =C2=A0 =C2=A0 =C2=A0Nothin' ever doesn't change, but nothin' chang= es much. > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0-- OK Go > > =C2=A0 =C2=A0 =C2=A0 =C2=A0Breadth of IT experience, and depth of knowled= ge in the DNS. > =C2=A0 =C2=A0 =C2=A0 =C2=A0Yours for the right price. =C2=A0:) =C2=A0http= ://SupersetSolutions.com/ > > --=20 "UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity." Dennis Ritchie --00163646d5be7d227c049b23e38f Content-Type: text/x-patch; charset=US-ASCII; name="20110131-freebsd-RELENG_8-rfc6056.patch" Content-Disposition: attachment; filename="20110131-freebsd-RELENG_8-rfc6056.patch" Content-Transfer-Encoding: base64 X-Attachment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3J0OworCisJ CQlpZiAoKmxhc3Rwb3J0IDwgZmlyc3QgfHwgKmxhc3Rwb3J0ID4gbGFzdCkKKwkJCQkqbGFzdHBv cnQgPSBmaXJzdDsKKwkJCWxwb3J0ID0gaHRvbnMoKmxhc3Rwb3J0KTsKKwkJfSB3aGlsZSAoaW42 X3BjYmxvb2t1cF9sb2NhbChwY2JpbmZvLCAmaW5wLT5pbjZwX2xhZGRyLAorCQkgICAgbHBvcnQs IHdpbGQsIGNyZWQpKTsKKwl9CiAKIAlpbnAtPmlucF9scG9ydCA9IGxwb3J0OwogCWlmIChpbl9w Y2JpbnNoYXNoKGlucCkgIT0gMCkgewo= --00163646d5be7d227c049b23e38f--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTim4=xa0rfoLgt-ao30XoZkLZ1hMYzE6LsrLNcbM>