2.2.0-alpha2 - inet_aton missing on ReliantUNIX - Alternative quick fix

Richard Bollinger rabollinger at home.com
Thu Feb 1 14:08:23 GMT 2001


This was our quick fix for the missing inet_aton on Solaris...

--- ../source/smbd/password.c Thu Jan 25 07:45:13 2001
+++ ./smbd/password.c Fri Jan 26 10:04:23 2001
@@ -23,6 +23,10 @@

 #include "includes.h"

+#if SUNOS5
+extern int inet_aton(const char *, struct in_addr *);
+#endif
+
 extern int DEBUGLEVEL;
 extern int Protocol;
 extern struct in_addr ipzero;
@@ -1594,3 +1598,14 @@
 }

 #undef OLD_NTDOMAIN
+
+#if SUNOS5
+int inet_aton(const char *cp, struct in_addr *inp)
+{
+  if (!strcmp(cp, "255.255.255.255")) {
+    inp->s_addr = 0xFFFFFFFF;
+    return 1;
+  }
+  return ((inp->s_addr = inet_addr(cp)) != 0xFFFFFFFF);
+}
+#endif

Of course, it would be nice if the configure process determined that it was missing and included the
substitute code automagically.  On the other hand, as far as I can see it is only used once in all
of Samba, so perhaps it should just be elimenated in favor of inet_addr()...

Rich Bollinger





More information about the samba-technical mailing list