1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
$NetBSD: patch-ai,v 1.2 2005/11/11 15:20:41 joerg Exp $
--- abuse/src/net/mac/tcpip.hpp 2002/07/16 13:57:41 1.1
+++ abuse/src/net/mac/tcpip.hpp 2002/07/16 13:59:05
@@ -146,6 +146,12 @@
void broadcastable();
} ;
+#if defined(__NetBSD__) || defined(__DragonFly__)
+#define SOCKLEN_TYPE __socklen_t
+#else
+#define SOCKLEN_TYPE int
+#endif
+
class tcp_socket : public unix_fd
{
int listening;
@@ -176,7 +182,7 @@
if (listening)
{
struct sockaddr_in from;
- int addr_len=sizeof(from);
+ SOCKLEN_TYPE addr_len=sizeof(from);
int new_fd=::accept(fd,(sockaddr *)&from,&addr_len);
if (new_fd>=0)
{
@@ -200,7 +206,7 @@
if (addr)
{
*addr=new ip_address;
- int addr_size=sizeof(sockaddr_in);
+ SOCKLEN_TYPE addr_size=sizeof(sockaddr_in);
tr=recvfrom(fd,buf,size,0, (sockaddr *) &((ip_address *)(*addr))->addr,&addr_size);
} else
tr=recv(fd,buf,size,0);
|