[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] make nse problems



You should add some type coercion there to cast int* to
socklen_t*:

--- net-ip.cc   2000/02/08 23:35:13     1.17
+++ net-ip.cc   2000/11/06 19:27:35
@@ -281,7 +281,7 @@
        sockaddr_in sfrom;
        int fromlen = sizeof(sfrom);
        int cc = ::recvfrom(rsock_, (char*)buf, len, 0,
-                           (sockaddr*)&sfrom, &fromlen);
+                           (sockaddr*)&sfrom, (socklen_t*)&fromlen);
        NIDEBUG5("UDPIPNetwork(%s): ::recvfrom(%d, buf, %d) returned
%d\n",
                name(), rsock_, len, cc);
        if (cc < 0) {
@@ -553,7 +553,7 @@
                abort();
        }
        int fromlen = sizeof(sa);
-       int cc = ::recvfrom(rsock_, (char*)buf, len, 0, &sa, &fromlen);
+       int cc = ::recvfrom(rsock_, (char*)buf, len, 0, &sa,
(socklen_t*)&fromlen);
        if (cc < 0) {
                if (errno != EWOULDBLOCK)
                        perror("recvfrom");

Somehow I didn't manage to fix this when building nse a couple
of months ago :(

This should appear in daily snapshot.

- Haobo

On Mon, 6 Nov 2000, Ian G. Clark ... *Sparks* wrote:

> Hi,
> 	Downloaded the `allinone' package for `ns' and it compiled
> out of the box on Redhat7, Yippee!
> 
> 	However when I then go into the `ns' directory and type
> `make nse' I get :-
> 
> --------------
> 
> [root ns-2.1b7]# make nse
> c++ -c -O2 -DTCP_DELAY_BIND_ALL -DNO_TK -DTCLCL_CLASSINSTVAR  -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_0A6 -DHAVE_OTCL_H -DHAVE_LIBTK8_3 -DHAVE_TK_H -DHAVE_LIBTCL8_3 -DHAVE_TCL_H  -DHAVE_CONFIG_H -I. -I/usr/local/ns/ns-allinone-2.1b7/tclcl-1.0b10 -I/usr/local/ns/ns-allinone-2.1b7/otcl-1.0a6 -I/usr/local/ns/ns-allinone-2.1b7/tk8.3.2/generic -I/usr/local/ns/ns-allinone-2.1b7/tcl8.3.2/generic -o emulate/net-ip.o emulate/net-ip.cc
> emulate/net-ip.cc: In method `int UDPIPNetwork::recv (unsigned char *,
> int, sockaddr &, double &)':
> emulate/net-ip.cc:284: cannot convert `int *' to `socklen_t *' for
> argument `6' to `recvfrom (int, void *, unsigned int, int, sockaddr *,
> socklen_t *)'
> emulate/net-ip.cc: In method `int IPNetwork::recv (unsigned char *,
> int, sockaddr &, double &)':
> emulate/net-ip.cc:556: cannot convert `int *' to `socklen_t *' for
> argument `6' to `recvfrom (int, void *, unsigned int, int, sockaddr *,
> socklen_t *)'
> make: *** [emulate/net-ip.o] Error 1  
> --------------
> 
> Help?
> 
> Thanks Ian
> 
>