Deleted Added
full compact
get_iface.c (143415) get_iface.c (178642)
1/*
2 * Copyright 1994, 1995 Massachusetts Institute of Technology
3 *
4 * Permission to use, copy, modify, and distribute this software and
5 * its documentation for any purpose and without fee is hereby
6 * granted, provided that both the above copyright notice and this
7 * permission notice appear in all copies, that both the above
8 * copyright notice and this permission notice appear in all

--- 15 unchanged lines hidden (view full) ---

24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
31
1/*
2 * Copyright 1994, 1995 Massachusetts Institute of Technology
3 *
4 * Permission to use, copy, modify, and distribute this software and
5 * its documentation for any purpose and without fee is hereby
6 * granted, provided that both the above copyright notice and this
7 * permission notice appear in all copies, that both the above
8 * copyright notice and this permission notice appear in all

--- 15 unchanged lines hidden (view full) ---

24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
31
32__FBSDID("$FreeBSD: head/usr.bin/talk/get_iface.c 143415 2005-03-11 14:17:12Z stefanf $");
32__FBSDID("$FreeBSD: head/usr.bin/talk/get_iface.c 178642 2008-04-28 21:08:42Z delphij $");
33
34/*
35 * From:
36 * Id: find_interface.c,v 1.1 1995/08/14 16:08:39 wollman Exp
37 */
38
39#include <errno.h>
40#include <string.h>
41
42#include "talk.h"
43
44/*
45 * Try to find the interface address that is used to route an IP
46 * packet to a remote peer.
47 */
48
49int
33
34/*
35 * From:
36 * Id: find_interface.c,v 1.1 1995/08/14 16:08:39 wollman Exp
37 */
38
39#include <errno.h>
40#include <string.h>
41
42#include "talk.h"
43
44/*
45 * Try to find the interface address that is used to route an IP
46 * packet to a remote peer.
47 */
48
49int
50get_iface(dst, iface)
51 struct in_addr *dst;
52 struct in_addr *iface;
50get_iface(struct in_addr *dst, struct in_addr *iface)
53{
54 static struct sockaddr_in local;
55 struct sockaddr_in remote;
56 socklen_t namelen;
57 int s, rv;
58
59 memcpy(&remote.sin_addr, dst, sizeof remote.sin_addr);
60 remote.sin_port = htons(60000);

--- 41 unchanged lines hidden ---
51{
52 static struct sockaddr_in local;
53 struct sockaddr_in remote;
54 socklen_t namelen;
55 int s, rv;
56
57 memcpy(&remote.sin_addr, dst, sizeof remote.sin_addr);
58 remote.sin_port = htons(60000);

--- 41 unchanged lines hidden ---