diff mbox

[OpenWrt-Devel,package] fix nfs-kernel-server for x86_64

Message ID CAGRVrQj-AHyHt6-mHp=6MOev3OtoSM_No6RwZkuVq12GD38Wvg@mail.gmail.com
State Deferred
Headers show

Commit Message

Giuseppe Magnotta Dec. 3, 2015, 10:04 a.m. UTC
Hi,

using the nfs-kernel-server package on openwrt x86_64 machine seems to
throw a bug in the rpc.mountd: it crashes when a client try to make a
remote mount.

I discovered a sort of bug by the combination of uclibc and nfs-utils.

There is also a thread to this page that explain it
https://bugs.alpinelinux.org/issues/1486.

I tried to patch the code as suggested there and it works correctly!

Please find attached a patch with the change.

I made it against the trunk

Hope to see it committed upstream.

Signed-off-by: Giuseppe Magnotta <giuseppe.magnotta@gmail.com>


Thank you

Best regards,
Giuseppe
diff mbox

Patch

--- a/support/export/hostname.c
+++ b/support/export/hostname.c
@@ -101,6 +101,7 @@ 
         .ai_protocol    = (int)IPPROTO_UDP,
         .ai_flags    = AI_NUMERICHOST,
         .ai_family    = AF_UNSPEC,
+        .ai_socktype    = 0,
     };
     struct sockaddr_in sin;
     int error, inet4;
@@ -351,6 +352,7 @@ 
     /*
      * getaddrinfo(AI_NUMERICHOST) never fills in ai_canonname
      */
+#ifndef __UCLIBC__
     if (ai != NULL) {
         free(ai->ai_canonname);        /* just in case */
         ai->ai_canonname = strdup(buf);
@@ -359,6 +361,7 @@ 
             ai = NULL;
         }
     }
+#endif

     return ai;
 }
@@ -384,7 +387,9 @@ 

     /*
      * getaddrinfo(AI_NUMERICHOST) never fills in ai_canonname
+     * ...well, it does on uclibc.
      */
+#ifndef __UCLIBC__
     if (ai != NULL) {
         ai->ai_canonname = strdup(buf);
         if (ai->ai_canonname == NULL) {
@@ -392,6 +397,7 @@ 
             ai = NULL;
         }
     }
+#endif

     return ai;
 }