From 5600327322a78a3a803368c0fe4f923cf14a4cf7 Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Tue, 14 Jul 2009 16:47:09 -0400 Subject: support: Introduce sockaddr helpers to get and set IP port numbers Introduce address family-agnostic functions that get and set IP port numbers in socket addresses. We can already replace a few similar functions in the mount command, and a few more will come up with statd and sm-notify. Signed-off-by: Chuck Lever Signed-off-by: Steve Dickson --- utils/mount/network.c | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'utils/mount') diff --git a/utils/mount/network.c b/utils/mount/network.c index 5b6f4c2..ad6c146 100644 --- a/utils/mount/network.c +++ b/utils/mount/network.c @@ -170,21 +170,6 @@ static const unsigned long probe_mnt3_first[] = { 0, }; -static void nfs_set_port(struct sockaddr *sap, const unsigned short port) -{ - switch (sap->sa_family) { - case AF_INET: - ((struct sockaddr_in *)sap)->sin_port = htons(port); - break; - case AF_INET6: - ((struct sockaddr_in6 *)sap)->sin6_port = htons(port); - break; - default: - nfs_error(_("%s: unrecognized address family in %s"), - progname, __func__); - } -} - static int nfs_lookup(const char *hostname, const sa_family_t family, struct sockaddr *sap, socklen_t *salen) { -- cgit