Date: Mon, 8 Feb 2021 12:46:13 -0500 From: Mark Johnston <markj@freebsd.org> To: Lutz Donnerhacke <lutz@donnerhacke.de> Cc: Lutz Donnerhacke <donner@freebsd.org>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 45d75e3ac3fb - main - netgraph/ng_base: Allow larger BINARY2ASCII conversions Message-ID: <YCF45eXShl6pqEgQ@raichu> In-Reply-To: <20210208160817.GA4953@belenus.iks-jena.de> References: <202102081335.118DZB5F024911@gitrepo.freebsd.org> <YCFWLmXYL5E79yKM@raichu> <20210208160817.GA4953@belenus.iks-jena.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Feb 08, 2021 at 05:08:17PM +0100, Lutz Donnerhacke wrote: > On Mon, Feb 08, 2021 at 10:18:06AM -0500, Mark Johnston wrote: > > On Mon, Feb 08, 2021 at 01:35:11PM +0000, Lutz Donnerhacke wrote: > > > The branch main has been updated by donner: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=45d75e3ac3fb5bf8230ca28dc09b48c6e5ed7a4f > > > > > > commit 45d75e3ac3fb5bf8230ca28dc09b48c6e5ed7a4f > > > Author: Lutz Donnerhacke <donner@FreeBSD.org> > > > AuthorDate: 2021-02-07 21:07:34 +0000 > > > Commit: Lutz Donnerhacke <donner@FreeBSD.org> > > > CommitDate: 2021-02-08 13:31:58 +0000 > > > > > > netgraph/ng_base: Allow larger BINARY2ASCII conversions > > > > > > Allocate the necessary memory for the conversion dynamically starting > > > with a value which is sufficient for almost all normal cases. > > > > Is there some upper bound on the length of the input message? > > Yes. Quote from D23840: > > : Of course, to transmit the data via the ng_socket, the buffer sizes needs > : to be adjusted manually. > > : net.graph.recvspace: 204800 > : net.graph.maxdgram: 204800 > > : To transmit arbitary large data, it's better to change the ng_socket > : interface (incl. libnetgraph), but that is out of scope of this issue > : here. Ok, thanks. I looked through the review but missed this. > > If not, a sufficiently large input looks like it could cause an infinite > > loop by triggering overflow in the bufSize *= 2 calculation. > > That's a valid point. Thank you. > > > I also wonder why the same change was not made for ASCII2BINARY. > > Because it's usually a compression. If you are able to send the ASCII > message, the binary message is shorter and will match anyway. But to answer > your question: It was not part of the PR, it's an nonissue. Ok.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YCF45eXShl6pqEgQ>