mirror of
https://github.com/ntop/n2n.git
synced 2024-09-20 00:51:10 +02:00
Merge pull request #122 from fengdaolong/dev
eliminate compilation warnings
This commit is contained in:
commit
90bcee24e5
|
@ -1274,13 +1274,13 @@ static void readFromTAPSocket(n2n_edge_t * eee) {
|
||||||
/* ************************************** */
|
/* ************************************** */
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
static DWORD tunReadThread(LPVOID lpArg) {
|
static DWORD* tunReadThread(LPVOID lpArg) {
|
||||||
n2n_edge_t *eee = (n2n_edge_t*)lpArg;
|
n2n_edge_t *eee = (n2n_edge_t*)lpArg;
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
readFromTAPSocket(eee);
|
readFromTAPSocket(eee);
|
||||||
|
|
||||||
return((DWORD)NULL);
|
return((DWORD*)NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************** */
|
/* ************************************** */
|
||||||
|
@ -1704,14 +1704,14 @@ static int edge_init_sockets(n2n_edge_t *eee, int udp_local_port, int mgmt_port)
|
||||||
u_int enable_reuse = 1;
|
u_int enable_reuse = 1;
|
||||||
|
|
||||||
/* allow multiple sockets to use the same PORT number */
|
/* allow multiple sockets to use the same PORT number */
|
||||||
setsockopt(eee->udp_multicast_sock, SOL_SOCKET, SO_REUSEADDR, &enable_reuse, sizeof(enable_reuse));
|
setsockopt(eee->udp_multicast_sock, SOL_SOCKET, SO_REUSEADDR, (char *)&enable_reuse, sizeof(enable_reuse));
|
||||||
#ifdef SO_REUSEPORT /* no SO_REUSEPORT in Windows / old linux versions */
|
#ifdef SO_REUSEPORT /* no SO_REUSEPORT in Windows / old linux versions */
|
||||||
setsockopt(eee->udp_multicast_sock, SOL_SOCKET, SO_REUSEPORT, &enable_reuse, sizeof(enable_reuse));
|
setsockopt(eee->udp_multicast_sock, SOL_SOCKET, SO_REUSEPORT, &enable_reuse, sizeof(enable_reuse));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mreq.imr_multiaddr.s_addr = inet_addr(N2N_MULTICAST_GROUP);
|
mreq.imr_multiaddr.s_addr = inet_addr(N2N_MULTICAST_GROUP);
|
||||||
mreq.imr_interface.s_addr = htonl(INADDR_ANY);
|
mreq.imr_interface.s_addr = htonl(INADDR_ANY);
|
||||||
if (setsockopt(eee->udp_multicast_sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) {
|
if (setsockopt(eee->udp_multicast_sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *)&mreq, sizeof(mreq)) < 0) {
|
||||||
traceEvent(TRACE_ERROR, "Failed to bind to local multicast group %s:%u [errno %u]",
|
traceEvent(TRACE_ERROR, "Failed to bind to local multicast group %s:%u [errno %u]",
|
||||||
N2N_MULTICAST_GROUP, N2N_MULTICAST_PORT, errno);
|
N2N_MULTICAST_GROUP, N2N_MULTICAST_PORT, errno);
|
||||||
|
|
||||||
|
|
2
sn.c
2
sn.c
|
@ -407,7 +407,7 @@ static int load_allowed_n2n_communities(char *path) {
|
||||||
char buffer[4096], *line;
|
char buffer[4096], *line;
|
||||||
FILE *fd = fopen(path, "r");
|
FILE *fd = fopen(path, "r");
|
||||||
struct n2n_allowed_communities *s, *tmp;
|
struct n2n_allowed_communities *s, *tmp;
|
||||||
u_int32_t num_communities = 0;
|
uint32_t num_communities = 0;
|
||||||
|
|
||||||
if(fd == NULL) {
|
if(fd == NULL) {
|
||||||
traceEvent(TRACE_WARNING, "File %s not found", path);
|
traceEvent(TRACE_WARNING, "File %s not found", path);
|
||||||
|
|
|
@ -13,7 +13,9 @@
|
||||||
|
|
||||||
#if defined(__MINGW32__)
|
#if defined(__MINGW32__)
|
||||||
/* should be defined here and before winsock gets included */
|
/* should be defined here and before winsock gets included */
|
||||||
|
#ifndef _WIN32_WINNT
|
||||||
#define _WIN32_WINNT 0x501 //Otherwise the linker doesnt find getaddrinfo
|
#define _WIN32_WINNT 0x501 //Otherwise the linker doesnt find getaddrinfo
|
||||||
|
#endif /* #ifndef _WIN32_WINNT */
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#endif /* #if defined(__MINGW32__) */
|
#endif /* #if defined(__MINGW32__) */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user