diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-05-14 19:46:05 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-05-14 19:46:05 +0200 |
commit | d3080be1317cfa0269b1c12c8f28ffe2c1855f98 (patch) | |
tree | e63661180b7cc217ee4a54c90332bca5c3ba91fe | |
parent | 67cd75f9fa0e9c2140cbef08a7774760470e32a1 (diff) |
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.
-rw-r--r-- | openbsc/src/ipaccess/ipaccess-find.c | 5 |
1 files changed, 2 insertions, 3 deletions
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); |