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.
diff --git a/openbsc/src/ipaccess/ipaccess-find.c b/openbsc/src/ipaccess/ipaccess-find.c
index b0db045..4b5f612 100644
--- a/openbsc/src/ipaccess/ipaccess-find.c
+++ b/openbsc/src/ipaccess/ipaccess-find.c
@@ -166,7 +166,7 @@
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 @@
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);