sm-notify: sm-notify doesn't handle localhost properly nfs-utils-1-2-5-rc2
authorChuck Lever <chuck.lever@oracle.com>
Mon, 29 Aug 2011 17:22:21 +0000 (13:22 -0400)
committerSteve Dickson <steved@redhat.com>
Mon, 29 Aug 2011 17:43:28 +0000 (13:43 -0400)
commitbbd9f5a98c3a401371bc642ac8545b1ccfeeab4d
treefde0f7906fcef9cd3c8881264faeebaef1c573d3
parent140468c2968472e871b972e400f58ad659458a2d
sm-notify: sm-notify doesn't handle localhost properly

It looks like the existing algorithm for verifying the passed-in bind
address is as broken as statd_matchhostname() used to be: for IP
addresses, AI_CANONNAME is useless.  We need to have getnameinfo(3) or
equivalent in there.

Clean up: extract the logic that verifies the command line bind
address into its own function, and make it handle canonical name
lookup correctly.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
utils/statd/sm-notify.c