On 03/04/13 07:24, Dave Brolley wrote:
On 04/02/2013 04:06 PM, Dave Brolley wrote:
Hi Ken,
With respect to commit 4b69271ebe5847dc730a5135a2fd1318ee8770ee, the
code for the { secure sockets enabled, secure sockets disabled } x {
ipv4, ipv6 } mix is unnecessary. All you need to do is to call
__pmSockAddrToString(saddr). It will take care of those details. It
returns a pointer to a string from the heap, so you don't need to know
the magic buffer size (46), but you do need to free it. You also do
need to check that it is not NULL. If if is NULL then you can issue an
error message.
Something like this should do it ....
Dave,
Thanks for the pointer to the wrapper routine that I did not know about.
Your change looks good to me (and much cleaner) ... although the error
string needs a leading space and no trailing \n to fit in with the
surrounding fprintf's. And the loss of the unknown family=%d diagnostic
in the invalid address case is probably not an issue (especially as it
cannot be reported without exposing the conditional mess you've just
hidden behind the __pmSockAddrToString() call!).
Do you want to push this to Nathan, or would you like me to apply to my
tree and push back to the official tree that way?
|