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.
This commit is contained in:
Holger Hans Peter Freyther 2011-05-14 19:46:05 +02:00
parent 67cd75f9fa
commit d3080be131
1 changed files with 2 additions and 3 deletions

View File

@ -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);