Whamcloud - gitweb
LU-10391 lnet: use %pISc for formatting IP addresses 85/48685/2
authorMr NeilBrown <neilb@suse.de>
Wed, 28 Sep 2022 04:41:47 +0000 (14:41 +1000)
committerOleg Drokin <green@whamcloud.com>
Mon, 10 Oct 2022 05:37:02 +0000 (05:37 +0000)
commited6b125bab5f7e383d8fa00acf75836922cfcb2a
treed9139511a7422764d5575c826965973218085d1a
parentb90c0100dd93b56f3bfaee037b3bdd077523f43e
LU-10391 lnet: use %pISc for formatting IP addresses

The Linux kernel's printf functionality understands %pIS to means that
a the address in a 'struct sockaddr' should be formated, either as
IPv4 or IPv6.  For IPv6, the verbose format showing all 16 bytes
whether zero or not is used.

To get the more familiar "compressed" format where strings of :0000:
are replaced with ::, we need to add the 'c' flag.  This is ignored
for IPv4.

When requesting the port as well ("%pISp), the 'c' and 'p' can appear
in either order.

So this patch changes all %pIS to %pISc as we always want the
compressed format.

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ida17f5008e06a00c5460cf7161ed07de8fa7a65d
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48685
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lnet/klnds/socklnd/socklnd.c
lnet/klnds/socklnd/socklnd_cb.c
lnet/klnds/socklnd/socklnd_proto.c
lnet/lnet/acceptor.c
lnet/lnet/lib-socket.c