projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Porting to FreeBSD:
[tinc]
/
src
/
net.c
diff --git
a/src/net.c
b/src/net.c
index
09d98f4
..
e7297d1
100644
(file)
--- a/
src/net.c
+++ b/
src/net.c
@@
-17,17
+17,13
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net.c,v 1.35.4.7
2 2000/11/15 01:28:21 zarq
Exp $
+ $Id: net.c,v 1.35.4.7
3 2000/11/15 13:33:26 guus
Exp $
*/
#include "config.h"
*/
#include "config.h"
-#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <errno.h>
#include <fcntl.h>
-/* SunOS really wants sys/socket.h BEFORE net/if.h */
-#include <sys/socket.h>
-#include <net/if.h>
#include <netdb.h>
#include <netinet/in.h>
#include <stdio.h>
#include <netdb.h>
#include <netinet/in.h>
#include <stdio.h>
@@
-39,6
+35,11
@@
#include <syslog.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <syslog.h>
#include <unistd.h>
#include <sys/ioctl.h>
+/* SunOS really wants sys/socket.h BEFORE net/if.h,
+ and FreeBSD wants these lines below the rest. */
+#include <arpa/inet.h>
+#include <sys/socket.h>
+#include <net/if.h>
#ifdef HAVE_OPENSSL_RAND_H
# include <openssl/rand.h>
#ifdef HAVE_OPENSSL_RAND_H
# include <openssl/rand.h>
@@
-1097,7
+1098,7
@@
conn_list_t *create_new_connection(int sfd)
cp
p = new_conn_list();
cp
p = new_conn_list();
- if(getpeername(sfd,
&ci,
&len) < 0)
+ if(getpeername(sfd,
(struct sockaddr *) &ci, (socklen_t *)
&len) < 0)
{
syslog(LOG_ERR, _("System call `%s' failed: %m"),
"getpeername");
{
syslog(LOG_ERR, _("System call `%s' failed: %m"),
"getpeername");