Mercurial > hg > quicktun
comparison src/common.c @ 63:fa4983c5f7ea
Fix floating remote mode on NetBSD
author | Ivo Smits <Ivo@UFO-Net.nl> |
---|---|
date | Sat, 07 Jan 2017 16:01:01 +0100 |
parents | 66d9d80215f0 |
children | fa53d1c54886 |
comparison
equal
deleted
inserted
replaced
62:5b9e742bb704 | 63:fa4983c5f7ea |
---|---|
299 | 299 |
300 static void qtsendnetworkpacket(struct qtsession* session, char* msg, int len) { | 300 static void qtsendnetworkpacket(struct qtsession* session, char* msg, int len) { |
301 if (session->remote_float == 0) { | 301 if (session->remote_float == 0) { |
302 len = write(session->fd_socket, msg, len); | 302 len = write(session->fd_socket, msg, len); |
303 } else if (session->remote_float == 2) { | 303 } else if (session->remote_float == 2) { |
304 len = sendto(session->fd_socket, msg, len, 0, (struct sockaddr*)&session->remote_addr, sizeof(sockaddr_any)); | 304 int sa_size = sizeof(sockaddr_any); |
305 if (session->remote_addr.any.sa_family == AF_INET) sa_size = sizeof(struct sockaddr_in); | |
306 else if (session->remote_addr.any.sa_family == AF_INET6) sa_size = sizeof(struct sockaddr_in6); | |
307 len = sendto(session->fd_socket, msg, len, 0, (struct sockaddr*)&session->remote_addr, sa_size); | |
305 } | 308 } |
306 } | 309 } |
307 | 310 |
308 int qtrun(struct qtproto* p) { | 311 int qtrun(struct qtproto* p) { |
309 if (getconf("DEBUG")) debug = 1; | 312 if (getconf("DEBUG")) debug = 1; |