Re: dhcpcd logging subsystem modification
Roy Marples
Mon Feb 10 11:45:40 2020
Hi Sergey
On 10/02/2020 08:46, Sergey Nikiforov wrote:
Here at Kaspersky we are using dhcpcd code pulled from NetBSD project and
patched to work on KasperskyOS. There is, however, an issue with logging
subsystem - we use our own which uses source code file name, line number etc.
The obvious solution is to replace functions like "loginfox" with macros, but
this can't be done without patching several tens of places where addresses of
such functions are taken to choose logging level ("debug"/"info" etc).
Will you accept a patch which will rename "loginfox" and similar functions, add
macros with old names ("loginfox" etc) calling renamed functions (to keep
existing logging syntax but prevent their addresses being taken) and adjust no
longer compilable places in code to use "logging level" parameter instead of
function pointer? This way everyone who needs logging with __LINE__ and similar
macros would not need to patch several tens of places in dhcpcd code.
Please show a small patch to demonstrate the intent.
From your description I don't see an issue, but would like to see the idea first.
If I would post this patch here and it would be accepted, it would get into
NetBSD source tree, am I right?
Eventually yes. I doubt it will hit the dhcpcd-8 branch so it won't appear until
NetBSD-10 (or 9.1 maybe) but if you track -current then you'll be fine.
Roy
Archive administrator: postmaster@marples.name