add back a check for sa_len in sockaddr structure.
[deb_libnfs.git] / lib / socket.c
index a26afe1e6b194e46bea861e1974705b9d56a5bd1..e4de894c854e3e752271b1a3cb6833b400ec1a2c 100644 (file)
@@ -15,6 +15,9 @@
    along with this program; if not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -25,6 +28,9 @@
 #include <rpc/rpc.h>
 #include <rpc/xdr.h>
 #include <arpa/inet.h>
+#ifdef HAVE_SYS_FILIO_H
+#include <sys/filio.h>
+#endif
 #include <sys/ioctl.h>
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -305,7 +311,7 @@ int rpc_connect_async(struct rpc_context *rpc, const char *server, int port, rpc
        switch (s.ss_family) {
        case AF_INET:
                socksize = sizeof(struct sockaddr_in);
-#ifdef HAVE_SOCK_SIN_LEN
+#ifdef HAVE_SOCKADDR_LEN
                sin->sin_len = socksize;
 #endif
                rpc->fd = socket(AF_INET, SOCK_STREAM, 0);
@@ -422,3 +428,8 @@ int rpc_set_udp_destination(struct rpc_context *rpc, char *addr, int port, int i
 
        return 0;
 }
+
+struct sockaddr *rpc_get_recv_sockaddr(struct rpc_context *rpc)
+{
+       return (struct sockaddr *)&rpc->udp_src;
+}