Re: [PATCH net] tipc: Return non-zero value from tipc_udp_addr2str() on error

From: Paolo Abeni
Date: Tue Jul 16 2024 - 09:11:01 EST


On 7/16/24 13:43, Tung Nguyen wrote:

I think that consistency with other tipc helpers here would be more
appropriate: IMHO no need to send a v2.

I do not think so. If you look at other helper functions for udp media, they use predefined error codes, for example:
tipc_udp_msg2addr()
{
...
return -EINVAL;
...
}

It's not a big deal really, but, as noted by Shigeru, all the other tipc_*_addr2str() callbacks return 1 on error and such callback is invoked via function pointer.

If only this one returns a negative error, modification to the function pointer callsite will become prone to errors (and stable backports more fragiles)

Cheers,

Paolo