From 8a65e020fd47ee6330f6b3e1d2e572d4b4158aa1 Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Mon, 5 Jun 2006 14:15:53 +0000 Subject: [PATCH] copyright and stuff --- dns.c | 14 +++++++------- dnstun.c | 4 +--- tun.c | 4 +--- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/dns.c b/dns.c index 1b381d1..b6d5d0c 100644 --- a/dns.c +++ b/dns.c @@ -1,7 +1,5 @@ /* - * Copyright (c) 2006 - * Bjorn Andersson , - * Erik Ekman + * Copyright (c) 2006 Bjorn Andersson , Erik Ekman * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -43,12 +41,13 @@ open_dns() bzero(&addr, sizeof(addr)); addr.sin_family = AF_INET; - addr.sin_port = 0; // choose an available port - addr.sin_addr.s_addr = INADDR_ANY; // listen on 0.0.0.0 + addr.sin_port = htons(0); // choose an available port + addr.sin_addr.s_addr = htonl(INADDR_ANY);// listen on 0.0.0.0 fd = socket(AF_INET, SOCK_DGRAM, 0); if(fd < 0) { - err(1, "Could not get UDP socket"); + warn("Could not get UDP socket"); + return 0; } flag = 1; @@ -58,7 +57,8 @@ open_dns() setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &flag, sizeof(flag)); if(bind(fd, (struct sockaddr*)&addr, sizeof(addr)) < 0) { - err(1, "Could not bind UDP socket locally"); + warn("Could not bind UDP socket locally"); + return 0; } printf("Opened UDP socket\n"); diff --git a/dnstun.c b/dnstun.c index 90d9933..df6ab2e 100644 --- a/dnstun.c +++ b/dnstun.c @@ -1,7 +1,5 @@ /* - * Copyright (c) 2006 - * Bjorn Andersson , - * Erik Ekman + * Copyright (c) 2006 Bjorn Andersson , Erik Ekman * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/tun.c b/tun.c index eb0b725..289bf40 100644 --- a/tun.c +++ b/tun.c @@ -1,7 +1,5 @@ /* - * Copyright (c) 2006 - * Bjorn Andersson , - * Erik Ekman + * Copyright (c) 2006 Bjorn Andersson , Erik Ekman * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above