Index: options.c =================================================================== RCS file: /sources/hurd/hurd/pfinet/options.c,v retrieving revision 1.11 diff -u -p -r1.11 options.c --- options.c 18 Jul 2001 16:56:57 -0000 1.11 +++ options.c 29 Jul 2006 10:56:56 -0000 @@ -1,6 +1,6 @@ /* Pfinet option parsing - Copyright (C) 1996,97,2000,01 Free Software Foundation, Inc. + Copyright (C) 1996,97,2000,01,06 Free Software Foundation, Inc. Written by Miles Bader @@ -365,7 +365,13 @@ trivfs_append_args (struct trivfs_contro ADD_ADDR_OPT ("netmask", mask); if (peer != addr) ADD_ADDR_OPT ("peer", peer); - /* XXX how do we figure out the default gateway? */ + + struct rt_key key = { 0 }; + struct fib_result res; + + 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