hello folks,

pfinet hasn't pushed the gateway-option in charge to the argz list, i.e.
if you called `fsysopts /servers/socket/2' it told about any configured
interface, it's ip address, confgiured peer address, etc. but not what the
current default route is.

the patch along ought to fix this.

cheers,
  stesie

  - % -

2006-07-28  Stefan Siegl  <[EMAIL PROTECTED]>

        * options.c (trivfs_append_args): Figure out address of default
        gateway and push --gateway option to argz.

-- 
Do not worry about your difficulties in mathematics;
I can assure you that mine are still greater.
                                  -- Albert Einstein
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 <[EMAIL PROTECTED]>
 
@@ -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
_______________________________________________
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd

Reply via email to