google-code-export / lusca-cache

Automatically exported from code.google.com/p/lusca-cache
0 stars 0 forks source link

comm_ips_tproxy2.c error too few arguments to function sqinet_get_v4_inaddr #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Compilling with tproxy2 support...

Making all in libiapp
make[1]: Entering directory `/usr/src/lusca/LUSCA_HEAD/libiapp'
gcc -DHAVE_CONFIG_H -I. -I. -I../include   -I/usr/kerberos/include     -m64
-Wall -g -O2 -D_REENTRANT -c comm_ips_tproxy2.c
comm_ips_tproxy2.c: In function âcomm_ips_bindâ:
comm_ips_tproxy2.c:49: error: too few arguments to function
âsqinet_get_v4_inaddrâ
comm_ips_tproxy2.c:59: warning: implicit declaration of function âinet_ntoaâ
comm_ips_tproxy2.c:61: warning: format â%sâ expects type âchar *â, but
argument 2 has type âintâ
comm_ips_tproxy2.c:45: warning: unused variable âportâ
comm_ips_tproxy2.c: In function âcomm_ips_restoreCapabilitiesâ:
comm_ips_tproxy2.c:93: warning: implicit declaration of function âxcallocâ
comm_ips_tproxy2.c:93: warning: cast to pointer from integer of different size
comm_ips_tproxy2.c:94: warning: cast to pointer from integer of different size
comm_ips_tproxy2.c:120: warning: implicit declaration of function âxfreeâ
make[1]: *** [comm_ips_tproxy2.o] Error 1
make[1]: Leaving directory `/usr/src/lusca/LUSCA_HEAD/libiapp'
make: *** [all-recursive] Error 1

Original issue reported on code.google.com by ajcor...@gmail.com on 17 Feb 2009 at 10:04

GoogleCodeExporter commented 9 years ago
here´s a patch !!

Index: libiapp/comm_ips_tproxy2.c
===================================================================
--- libiapp/comm_ips_tproxy2.c  (revision 13809)
+++ libiapp/comm_ips_tproxy2.c  (working copy)
@@ -9,6 +9,7 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
+#include <arpa/inet.h>

 #include <linux/netfilter_ipv4.h>
 #include <linux/netfilter_ipv4/ip_tproxy.h>
@@ -37,16 +38,18 @@
 #include <sys/prctl.h>
 #endif

+#include "../include/util.h"
+
+
 int
 comm_ips_bind(int fd, sqaddr_t *a)
 {
        if (sqinet_get_family(a) != AF_INET)
                return COMM_ERROR;
-       u_short port = sqinet_get_port(a);

        struct in_tproxy itp;

-        itp.v.addr.faddr.s_addr = sqinet_get_v4_inaddr(a);
+        itp.v.addr.faddr = sqinet_get_v4_inaddr(a,SQADDR_ASSERT_IS_V4);
        /* XXX the "port" is 0 here - so tproxy2 selects an outbound port rather than
also spoofing the port */
         itp.v.addr.fport = 0;

Original comment by ajcor...@gmail.com on 19 Feb 2009 at 4:01

GoogleCodeExporter commented 9 years ago
Looks fine! Commit it when you're happy to.

Original comment by adrian.c...@gmail.com on 19 Feb 2009 at 4:03

GoogleCodeExporter commented 9 years ago
Alexandre committed this a while back!

Original comment by adrian.c...@gmail.com on 13 Apr 2009 at 8:30