16 May
2024
16 May
'24
9:49 a.m.
On Thu, 16 May 2024 16:54:24 +1000
David Gibson
On Thu, May 16, 2024 at 03:25:56PM +1000, David Gibson wrote:
When reporting errors, we sometimes want to show a relevant socket address. Doing so by extracting the various relevant fields can be pretty awkward, so introduce a sockaddr_ntop() helper to make it simpler. For now we just have one user in tcp.c, but I have further upcoming patches which can make use of it.
Realised I had an off-by-one error in my calculation of the max buffer size for this. Fixed version coming.
While at it, I was also wondering: would it be reasonably feasible, without killing readability, to get inet_ntop() to write directly to the buffer? I haven't tried to do it though. -- Stefano