From d3080be1317cfa0269b1c12c8f28ffe2c1855f98 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 14 May 2011 19:46:05 +0200 Subject: ipaccess-find: Work without providing an interface name This will use the default route of the operating system, e.g. be able to use ipaccess-find without special permission. --- openbsc/src/ipaccess/ipaccess-find.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'openbsc/src/ipaccess') diff --git a/openbsc/src/ipaccess/ipaccess-find.c b/openbsc/src/ipaccess/ipaccess-find.c index b0db045c5..4b5f6122a 100644 --- a/openbsc/src/ipaccess/ipaccess-find.c +++ b/openbsc/src/ipaccess/ipaccess-find.c @@ -166,7 +166,7 @@ static void timer_cb(void *_data) int main(int argc, char **argv) { struct osmo_fd bfd; - char *ifname; + char *ifname = NULL; int rc; printf("ipaccess-find (C) 2009 by Harald Welte\n"); @@ -175,10 +175,9 @@ int main(int argc, char **argv) if (argc < 2) { fprintf(stdout, "you might need to specify the outgoing\n" " network interface, e.g. ``%s eth0''\n", argv[0]); - exit(EXIT_FAILURE); + ifname = argv[1]; } - ifname = argv[1]; bfd.cb = bfd_cb; bfd.when = BSC_FD_READ | BSC_FD_WRITE; bfd.fd = udp_sock(ifname); -- cgit v1.2.3