Hi,
Here are two fixes for ipconfig/dhcp, the second of them being required for my
dhcp3 server to accept ipconfig's requests.
Thanks,
Louis
Louis Rilling (2):
ipconfig: Fix missing dhcp_end field
ipconfig: Fix null ciaddr on DHCPREQUEST during SELECTING state
usr/kinit/ipconfig/dhcp_proto.c | 4 ++--
usr/kinit/ipconfig/packet.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
--
Dr Louis Rilling Kerlabs
Skype: louis.rilling Batiment Germanium
Phone: (+33|0) 6 80 89 08 23 80 avenue des Buttes de Coesmes
http://www.kerlabs.com/ 35700 Rennes
Louis Rilling
2010-Mar-16 14:16 UTC
[klibc] [PATCH 1/2] ipconfig: Fix missing dhcp_end field
Commit b4bad5be5fa41416bf67fa1fba0624a0c541ea39
Author: Aron Griffis <agriffis at n01se.net>
Date: Sun Jun 21 22:40:17 2009 -0400
ipconfig: omit zero-length DHCP vendor_class_identifier
made the call to dhcp_send()->packet_send() take a variable iov_len, which
was
unfortunately truncated by one.
Fix this and the mis-leading comment of packet_send().
Signed-off-by: Louis Rilling <louis.rilling at kerlabs.com>
---
usr/kinit/ipconfig/dhcp_proto.c | 2 +-
usr/kinit/ipconfig/packet.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/usr/kinit/ipconfig/dhcp_proto.c b/usr/kinit/ipconfig/dhcp_proto.c
index f3cfd52..d6990ac 100644
--- a/usr/kinit/ipconfig/dhcp_proto.c
+++ b/usr/kinit/ipconfig/dhcp_proto.c
@@ -212,7 +212,7 @@ static int dhcp_send(struct netdev *dev, struct iovec *vec)
vec[i].iov_base = dhcp_end;
vec[i].iov_len = sizeof(dhcp_end);
- return packet_send(dev, vec, i);
+ return packet_send(dev, vec, i + 1);
}
/*
diff --git a/usr/kinit/ipconfig/packet.c b/usr/kinit/ipconfig/packet.c
index 283cf02..aedf51a 100644
--- a/usr/kinit/ipconfig/packet.c
+++ b/usr/kinit/ipconfig/packet.c
@@ -108,7 +108,7 @@ static char *ntoa(uint32_t addr)
#endif
/*
- * Send a packet. The options are listed in iov[1...iov_len].
+ * Send a packet. The options are listed in iov[1...iov_len-1].
* iov[0] is reserved for the bootp packet header.
*/
int packet_send(struct netdev *dev, struct iovec *iov, int iov_len)
--
1.5.6.5
Louis Rilling
2010-Mar-16 14:16 UTC
[klibc] [PATCH 2/2] ipconfig: Fix null ciaddr on DHCPREQUEST during SELECTING state
Commit cfc8d649a959f845983aae4c0fc33a0a0c995c92
Author: maximilian attems <max at stro.at>
Date: Fri Sep 5 22:48:27 2008 +0200
[klibc] ipconfig: set null ciaddr on DHCPREQUEST during SELECTING state
set ciaddr to INADDR_NONE instead of INADDR_ANY, which makes dhcpd3 reply by
NACK.
Fix this.
Signed-off-by: Louis Rilling <louis.rilling at kerlabs.com>
---
usr/kinit/ipconfig/dhcp_proto.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/usr/kinit/ipconfig/dhcp_proto.c b/usr/kinit/ipconfig/dhcp_proto.c
index d6990ac..3253490 100644
--- a/usr/kinit/ipconfig/dhcp_proto.c
+++ b/usr/kinit/ipconfig/dhcp_proto.c
@@ -175,7 +175,7 @@ static int dhcp_send(struct netdev *dev, struct iovec *vec)
bootp.htype = dev->hwtype;
bootp.hlen = dev->hwlen;
bootp.xid = dev->bootp.xid;
- bootp.ciaddr = INADDR_NONE;
+ bootp.ciaddr = INADDR_ANY;
bootp.yiaddr = dev->ip_addr;
bootp.giaddr = INADDR_ANY;
bootp.secs = htons(time(NULL) - dev->open_time);
--
1.5.6.5
On Tue, Mar 16, 2010 at 03:16:31PM +0100, Louis Rilling wrote:> > Hi, > > Here are two fixes for ipconfig/dhcp, the second of them being required for my > dhcp3 server to accept ipconfig's requests. > > Thanks, > > Louis > > Louis Rilling (2): > ipconfig: Fix missing dhcp_end field > ipconfig: Fix null ciaddr on DHCPREQUEST during SELECTING state > > usr/kinit/ipconfig/dhcp_proto.c | 4 ++-- > usr/kinit/ipconfig/packet.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-)hmm this confuses me both are in klibc git and got released. so you should just be set with 1.5.16 (unless of course build bails out, but for this I posted the patches in the pull request to hpa :) also in Debian you can install unstable klibc just fine in stable there is no cross dep on glibc or stuff. thanks for feedback!
Aron Griffis
2010-Mar-17 02:33 UTC
[klibc] [PATCH 1/2] ipconfig: Fix missing dhcp_end field
Louis Rilling wrote: [Tue Mar 16 2010, 10:16:32AM EDT]> Commit b4bad5be5fa41416bf67fa1fba0624a0c541ea39 > Author: Aron Griffis <agriffis at n01se.net> > Date: Sun Jun 21 22:40:17 2009 -0400 > > ipconfig: omit zero-length DHCP vendor_class_identifier > > made the call to dhcp_send()->packet_send() take a variable iov_len, which was > unfortunately truncated by one. > > Fix this and the mis-leading comment of packet_send(). > > Signed-off-by: Louis Rilling <louis.rilling at kerlabs.com>Thank you for fixing this, Louis. Regards, Aron