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

Giuseppe Magnotta giuseppe.magnotta at gmail.com
Thu Dec 3 05:04:37 EST 2015


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 at gmail.com>


Thank you

Best regards,
Giuseppe

--- 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;
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20151203/43da034e/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list