]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - support/nfs/rpcmisc.c
Cleanup xlog logging code to be safe and usable for all
[nfs-utils.git] / support / nfs / rpcmisc.c
index 5b0a88ff76745ea86c019718272bd3c10c66fa77..fcc6433390daca106fc1582916b7b841898c17eb 100644 (file)
@@ -47,7 +47,9 @@ int   _rpcfdtype = 0;
 int    _rpcsvcdirty = 0;
 
 void
-rpc_init(char *name, int prog, int vers, void (*dispatch)(), int defport)
+rpc_init(char *name, int prog, int vers,
+        void (*dispatch)(struct svc_req *, register SVCXPRT *),
+        int defport)
 {
        struct sockaddr_in saddr;
        SVCXPRT *transp;
@@ -184,8 +186,11 @@ int makesock(int port, int proto)
        sin.sin_port = htons(port);
 
        val = 1;
-       if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) < 0)
-               xlog(L_ERROR, "setsockopt failed: %s\n", strerror(errno));
+       if (proto == IPPROTO_TCP)
+               if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
+                              &val, sizeof(val)) < 0)
+                       xlog(L_ERROR, "setsockopt failed: %s\n",
+                            strerror(errno));
 
 #if 0
        /* I was told it didn't work with gigabit ethernet.