7 Jun
2019
7 Jun
'19
11:06 a.m.
Hi, On 6/7/19 12:43 PM, David Lamparter wrote:
The idea is that instead of doing:
if (debug) { char buf[]; zlog_debug("%s", inet_ntop(AF_INET, &addr, buf, sizeof(buf))); }
you can do:
if (debug) zlog_debug("%pI4", &addr);
For example, "%pI4" is used to print a "struct in_addr *" as A.B.C.D, with the inet_ntop() call happening inside of printfrr() instead of separately beforehand.
It's really cool to see this longstanding idea finally implemented. I think it will make it a lot nicer to write code for FRR, while at the same time allowing the code to be more concise and readable. Great job everyone who made this possible! All Best, Chris