lib: Remove unused client_socket_addr()
authorVolker Lendecke <vl@samba.org>
Fri, 17 Jul 2020 10:55:53 +0000 (12:55 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 17 Aug 2020 19:35:37 +0000 (19:35 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/util/util_net.c
lib/util/util_net.h
source3/include/proto.h

index ad6ee79208412b993f0ad1b59ec5bbd597ff225e..8b416455a9f8cc6bfcb2542a7df02d6958c3e491 100644 (file)
@@ -927,44 +927,6 @@ int get_socket_port(int fd)
        return -1;
 }
 
-/****************************************************************************
- Return the string of an IP address (IPv4 or IPv6).
-****************************************************************************/
-
-static const char *get_socket_addr(int fd, char *addr_buf, size_t addr_len)
-{
-       struct sockaddr_storage sa;
-       socklen_t length = sizeof(sa);
-
-       /* Ok, returning a hard coded IPv4 address
-        * is bogus, but it's just as bogus as a
-        * zero IPv6 address. No good choice here.
-        */
-
-       if (strlcpy(addr_buf, "0.0.0.0", addr_len) >= addr_len) {
-               /* Truncate ! */
-               return NULL;
-       }
-
-       if (fd == -1) {
-               return addr_buf;
-       }
-
-       if (getsockname(fd, (struct sockaddr *)&sa, &length) < 0) {
-               DEBUG(0,("getsockname failed. Error was %s\n",
-                       strerror(errno) ));
-               return addr_buf;
-       }
-
-       return print_sockaddr_len(addr_buf, addr_len, (struct sockaddr *)&sa, length);
-}
-
-const char *client_socket_addr(int fd, char *addr, size_t addr_len)
-{
-       return get_socket_addr(fd, addr, addr_len);
-}
-
-
 enum SOCK_OPT_TYPES {OPT_BOOL,OPT_INT,OPT_ON};
 
 typedef struct smb_socket_option {
index a14f9a95171a448dae201c57496c282bb2f188d8..6e991b8f904199576a4cae014720d8ac282b99e4 100644 (file)
@@ -121,7 +121,6 @@ char *print_sockaddr(char *dest,
 char *print_canonical_sockaddr(TALLOC_CTX *ctx,
                        const struct sockaddr_storage *pss);
 int get_socket_port(int fd);
-const char *client_socket_addr(int fd, char *addr, size_t addr_len);
 
 void set_socket_options(int fd, const char *options);
 
index 0717e4c3f4fe4505cb5005ee8445171c032807c8..1027d4e091a3812463f908a39e78872420c9ad18 100644 (file)
@@ -520,7 +520,6 @@ char *print_sockaddr(char *dest,
 char *print_canonical_sockaddr(TALLOC_CTX *ctx,
                        const struct sockaddr_storage *pss);
 int get_socket_port(int fd);
-const char *client_socket_addr(int fd, char *addr, size_t addr_len);
 int client_socket_port(int fd);
 bool is_a_socket(int fd);
 void set_socket_options(int fd, const char *options);