From c74c6f31d1786c2ae8eaab90f434bd833493034d Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 31 Jul 2006 10:41:08 +0000 Subject: 2006-07-31 Stefan Siegl * options.c (trivfs_append_args): Figure out the address of the default gateway and push the --gateway option to argz. --- pfinet/ChangeLog | 5 +++++ pfinet/options.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'pfinet') diff --git a/pfinet/ChangeLog b/pfinet/ChangeLog index 6a1bbc6d..95e46fdf 100644 --- a/pfinet/ChangeLog +++ b/pfinet/ChangeLog @@ -1,3 +1,8 @@ +2006-07-31 Stefan Siegl + + * options.c (trivfs_append_args): Figure out the address of the default + gateway and push the --gateway option to argz. + 2006-04-27 Thomas Schwinge * ethernet.c (ether_filter) [NETF_IN]: Prefix `NETF_IN' to the actual diff --git a/pfinet/options.c b/pfinet/options.c index 92534982..d05ac6d0 100644 --- a/pfinet/options.c +++ b/pfinet/options.c @@ -1,6 +1,6 @@ /* Pfinet option parsing - Copyright (C) 1996,97,2000,01 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 2000, 2001, 2006 Free Software Foundation, Inc. Written by Miles Bader @@ -345,6 +345,8 @@ trivfs_append_args (struct trivfs_control *fsys, char **argz, size_t *argz_len) { error_t err = 0; uint32_t addr, mask, peer, broad; + struct rt_key key = { 0 }; + struct fib_result res; inquire_device (dev, &addr, &mask, &peer, &broad); @@ -365,7 +367,9 @@ trivfs_append_args (struct trivfs_control *fsys, char **argz, size_t *argz_len) ADD_ADDR_OPT ("netmask", mask); if (peer != addr) ADD_ADDR_OPT ("peer", peer); - /* XXX how do we figure out the default gateway? */ + key.iif = dev->ifindex; + if (! main_table->tb_lookup (main_table, &key, &res)) + ADD_ADDR_OPT ("gateway", FIB_RES_GW (res)); #undef ADD_ADDR_OPT #undef ADD_OPT -- cgit v1.2.3