5980 in-kernel inet_ntop should format IPv4 addresses like userland one
Review Request #622 — Created July 7, 2017 and submitted
Information | |
---|---|
yuripv | |
illumos-gate | |
master | |
5980 | |
185011c... | |
Reviewers | |
general | |
This changes the format inet_ntop() uses for IPv4 addresses to be the
same as userland one (which makes more sense).The list of current kernel's inet_ntop() consumers with comments:
https://gist.github.com/yuripv/cbf201e7450eab867b510577cdb8188c
The only consumer that requires attention is
usr/src/uts/common/io/scsi/adapters/iscsi/persistent.c as it uses the IP
addresses as keys into persistent storage, so I've added a wrapper there
keeping old inet_ntop() behaviour - adding the logic which would rewrite
the nvlist names for such entries is just not worth it IMO.Everything else is using inet_ntop() to print log messages, or was
already using a wrapper to fix the format (like SMB and iscsit).
Checked that iscsiadm can delete/update the entries in persistent storage that were created in previous BE.
-
-
usr/src/common/smbsrv/smb_inet.c (Diff revision 1) It looks like this function is redundant since now. Doesn't it?
-
usr/src/common/smbsrv/smb_inet.c (Diff revision 1) Why #if/#else is required after fixed inet_ntop() ?
-
usr/src/uts/common/inet/ip/inet_ntop.c (Diff revision 1) Why @addrlen type is 'int' and not socklen_t ?
-
-
usr/src/uts/common/io/idm/idm_so.c (Diff revision 1) Why did you remove this check? Without it
snprintf()
below can silently truncate result.
With this check the function will return 'bogus_ip' if size is too small.
So this patch changes function behaviour whereas the patch should be just refactoring as I understand. Or you wanted to change this behaviour intentionally ?