File bnc#558744.diff of Package dhcpcd
diff -u dhcpcd-3.2.3-patched//dhcp.c dhcpcd-3.2.3//dhcp.c
--- dhcpcd-3.2.3-patched//dhcp.c 2009-11-27 21:50:34.755671212 +0100
+++ dhcpcd-3.2.3//dhcp.c 2009-11-27 21:52:13.374669989 +0100
@@ -653,6 +653,8 @@
return (-1);
}
+ dhcp->siaddr = message->siaddr;
+ dhcp->giaddr = message->giaddr;
dhcp->address.s_addr = message->yiaddr;
dhcp->leasedfrom = tv.tv_sec;
dhcp->frominfo = false;
diff -u dhcpcd-3.2.3-patched//dhcp.h dhcpcd-3.2.3//dhcp.h
--- dhcpcd-3.2.3-patched//dhcp.h 2009-11-27 21:50:34.755671212 +0100
+++ dhcpcd-3.2.3//dhcp.h 2009-11-27 21:52:13.374669989 +0100
@@ -200,6 +200,8 @@
struct address_head *netbiosddservers;
char *netbiosscope;
char *netbiosnodetype;
+ uint32_t siaddr;
+ uint32_t giaddr;
} dhcp_t;
diff -u dhcpcd-3.2.3-patched//info.c dhcpcd-3.2.3//info.c
--- dhcpcd-3.2.3-patched//info.c 2009-11-27 21:50:34.755671212 +0100
+++ dhcpcd-3.2.3//info.c 2009-11-27 22:04:59.934820658 +0100
@@ -107,6 +107,7 @@
FILE *f;
route_t *route;
struct stat sb;
+ struct in_addr n;
if (options->test)
f = stdout;
@@ -121,9 +122,15 @@
return (false);
}
}
-
+ if (dhcp->giaddr) {
+ n.s_addr = dhcp->giaddr;
+ fprintf (f, "DHCPGIADDR='%s'\n", inet_ntoa (n));
+ }
+ if (dhcp->siaddr) {
+ n.s_addr = dhcp->siaddr;
+ fprintf (f, "DHCPSIADDR='%s'\n", inet_ntoa (n));
+ }
if (dhcp->address.s_addr) {
- struct in_addr n;
n.s_addr = dhcp->address.s_addr & dhcp->netmask.s_addr;
fprintf (f, "IPADDR='%s'\n", inet_ntoa (dhcp->address));
fprintf (f, "NETMASK='%s'\n", inet_ntoa (dhcp->netmask));