File dhcpcd-3.2.3-set-route.diff of Package dhcpcd

diff -u dhcpcd-3.2.3-ntp-runtime-servers/configure.c dhcpcd-3.2.3-set-route/configure.c
--- dhcpcd-3.2.3-ntp-runtime-servers/configure.c	2008-09-03 11:22:23.000000000 +0200
+++ dhcpcd-3.2.3-set-route/configure.c	2008-09-03 11:26:50.000000000 +0200
@@ -703,6 +703,15 @@
 		    ! options->dogateway)
 			continue;
 
+                /*If the gateway address is not in our network we have to set a route for it */
+                if (( route->gateway.s_addr != INADDR_ANY ) && ((route->gateway.s_addr & dhcp->netmask.s_addr ) != ( dhcp->address.s_addr & dhcp->netmask.s_addr )))
+                {
+                        struct in_addr tn;
+                        memset (&tn, 0, sizeof (tn));
+                        struct in_addr tg;  tg.s_addr = INADDR_BROADCAST;
+                        remember = add_route (iface->name, route->gateway, tg,  tn, options->metric);
+                }
+
 		remember = add_route (iface->name, route->destination,
 				      route->netmask,  route->gateway,
 				      options->metric);
openSUSE Build Service is sponsored by