[Snort-users] Libnet make fatal error

Dirk Geschke Dirk_Geschke at ...1344...
Fri Nov 14 01:13:09 EST 2003


Hi Shekar,

> I'm trying to run make on libnet 1.1 and I'm getting the following fatal
> error. 
>  
> Does anybody have answer for this?
>  
> BTW: I read a mail with similar problem. Somebody has suggested to go with
> libnet 1.0.2 instead. I tried both, no luck. 
>  
> Please let me know if anybody has suggestions...
> 
> Note: This is on Solaris sparc 2.9 host

for snort you will need 1.0.2, the API of libnet changed with version 1.1
and is not backward compatible.

There is a problem with solaris and the function gethostbyaddr() and
gethosbyname2(). They are not part of the system libraries...

I append a simple patch to fix this problem.

Best regards

Dirk

-------------- next part --------------
--- libnet_resolve.c.   2002-08-24 16:21:23.791842000 -0400
+++ libnet_resolve.c    2002-08-24 16:06:27.291842000 -0400
@@ -185,8 +185,12 @@

     if (use_name == LIBNET_RESOLVE)
     {
+#ifdef HAVE_SOLARIS
+       host_ent = getipnodebyaddr((char *)&addr, sizeof(struct in_addr), AF_INET6, NULL);
+#else
         host_ent = gethostbyaddr((char *)&addr, sizeof(struct in_addr),
                 AF_INET6);
+#endif
     }
     if (!host_ent)
     {
@@ -218,7 +222,11 @@

     if (use_name == LIBNET_RESOLVE)
     {
+#ifdef HAVE_SOLARIS
+       if (!(host_ent = getipnodebyname(host_name, AF_INET6, AI_DEFAULT, NULL)))
+#else
         if (!(host_ent = gethostbyname2(host_name, AF_INET6)))
+#endif
         {
             snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
                     "libnet_name2addr6(): %s", strerror(errno));


More information about the Snort-users mailing list