--- dhcprelay-0.3.1/src/dhcprelay.c	2002-08-22 11:41:30.000000000 +0200
+++ dhcprelay-0.3.1-laforge/src/dhcprelay.c	2004-09-13 22:28:50.000000000 +0200
@@ -402,7 +402,8 @@
     xid_list.next = item;
 
     /* add gateway address */
-    p->giaddr = gw_ip;
+    if (get_dev_ip(client_dev[client], &p->giaddr) < 0)
+	p->giaddr = gw_ip;
 
     /* add relay agent information option if it dosen't already exist */
     if (get_dhcp_option(p, DHO_DHCP_AGENT_OPTIONS) == NULL)
