summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-23 21:08:13 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-23 21:08:13 +0200
commit22f566c39b564c39eca40a76bf1dfece96d7ece5 (patch)
tree7b153d86035be3d6eaa83cb6eb34cb67f24c3f56
parent7577d9ebf06fcdb630b2cdaab8772a6da9e37b70 (diff)
downloadsamba-22f566c39b564c39eca40a76bf1dfece96d7ece5.tar.gz
samba-22f566c39b564c39eca40a76bf1dfece96d7ece5.tar.bz2
samba-22f566c39b564c39eca40a76bf1dfece96d7ece5.zip
Move set_sockaddr_port to libutil.
-rw-r--r--lib/util/util_net.c14
-rw-r--r--source3/lib/util_sock.c12
2 files changed, 14 insertions, 12 deletions
diff --git a/lib/util/util_net.c b/lib/util/util_net.c
index eb5e2255c9..228393a2bb 100644
--- a/lib/util/util_net.c
+++ b/lib/util/util_net.c
@@ -408,3 +408,17 @@ bool is_address_any(const struct sockaddr *psa)
}
return false;
}
+
+void set_sockaddr_port(struct sockaddr *psa, uint16_t port)
+{
+#if defined(HAVE_IPV6)
+ if (psa->sa_family == AF_INET6) {
+ ((struct sockaddr_in6 *)psa)->sin6_port = htons(port);
+ }
+#endif
+ if (psa->sa_family == AF_INET) {
+ ((struct sockaddr_in *)psa)->sin_port = htons(port);
+ }
+}
+
+
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 667dbf6dad..5721f412d6 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -241,18 +241,6 @@ static int get_socket_port(int fd)
}
#endif
-void set_sockaddr_port(struct sockaddr_storage *psa, uint16 port)
-{
-#if defined(HAVE_IPV6)
- if (psa->ss_family == AF_INET6) {
- ((struct sockaddr_in6 *)psa)->sin6_port = htons(port);
- }
-#endif
- if (psa->ss_family == AF_INET) {
- ((struct sockaddr_in *)psa)->sin_port = htons(port);
- }
-}
-
const char *client_name(int fd)
{
return get_peer_name(fd,false);