search for: dhcp_parse

Displaying 7 results from an estimated 7 matches for "dhcp_parse".

2025 Feb 15
1
[PATCH] ipconfig: align reads of ext for sparc64
...onfig/dhcp_proto.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr/kinit/ipconfig/dhcp_proto.c b/usr/kinit/ipconfig/dhcp_proto.c index 4e560b84..2b83de45 100644 --- a/usr/kinit/ipconfig/dhcp_proto.c +++ b/usr/kinit/ipconfig/dhcp_proto.c @@ -112,8 +112,11 @@ static int dhcp_parse(struct netdev *dev, struct bootp_hdr *hdr, break; switch (opt) { case 51: /* IP Address Lease Time */ - if (len == 4) - leasetime = ntohl(*(uint32_t *)ext); + if (len == 4) { + /* Sparc64 needs ext reads to be type aligned */ + memcpy(&leasetime, ext, 4); + le...
2008 Jun 14
5
PATCH: ipconfig may accept DHCPOFFER as DHCPACK
...er environments. Scenario: ipconfig sends a DHCP_DISCOVER, server A answers with a DHCP_OFFER, server B answers with a DHCP_OFFER, ipconfig sends a DHCP_REQUEST for server A, ipconfig accepts the DHCP_OFFER from server B instead of DHCP_ACK from server A. <== BUG The reason for this was that in dhcp_parse(), DHCPOFFER and DHCPACK returned the same value (=1). So I had to modify the return values, and I thought it would be better to return the constants DHCPOFFER, DHCPACK etc instead of 1,2,3... I tried to keep the changes as minimal as possible. I'm not experienced with the diff program, so ple...
2025 Feb 28
0
[PATCH] ipconfig: align reads of ext for RISC architectures
...onfig/dhcp_proto.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr/kinit/ipconfig/dhcp_proto.c b/usr/kinit/ipconfig/dhcp_proto.c index 4e560b84..2b83de45 100644 --- a/usr/kinit/ipconfig/dhcp_proto.c +++ b/usr/kinit/ipconfig/dhcp_proto.c @@ -112,8 +112,11 @@ static int dhcp_parse(struct netdev *dev, struct bootp_hdr *hdr, break; switch (opt) { case 51: /* IP Address Lease Time */ - if (len == 4) - leasetime = ntohl(*(uint32_t *)ext); + if (len == 4) { + /* Sparc64 needs ext reads to be type aligned */ + memcpy(&leasetime, ext, 4); + le...
2025 Feb 28
1
[PATCH v2] ipconfig: align reads of ext for RISC architectures
...onfig/dhcp_proto.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr/kinit/ipconfig/dhcp_proto.c b/usr/kinit/ipconfig/dhcp_proto.c index 4e560b84..2b83de45 100644 --- a/usr/kinit/ipconfig/dhcp_proto.c +++ b/usr/kinit/ipconfig/dhcp_proto.c @@ -112,8 +112,11 @@ static int dhcp_parse(struct netdev *dev, struct bootp_hdr *hdr, break; switch (opt) { case 51: /* IP Address Lease Time */ - if (len == 4) - leasetime = ntohl(*(uint32_t *)ext); + if (len == 4) { + /* Sparc64 needs ext reads to be type aligned */ + memcpy(&leasetime, ext, 4); + le...
2012 May 22
0
[klibc:master] ipconfig: Write $DOMAINSEARCH as domain-search
...o.c +++ b/usr/kinit/ipconfig/dhcp_proto.c @@ -25,6 +25,7 @@ static uint8_t dhcp_params[] = { 26, /* interface mtu */ 28, /* broadcast addr */ 40, /* NIS domain name (why?) */ + 119, /* Domain Search Option */ }; static uint8_t dhcp_discover_hdr[] = { @@ -158,7 +159,7 @@ static int dhcp_parse(struct netdev *dev, struct bootp_hdr *hdr, static int dhcp_recv(struct netdev *dev) { struct bootp_hdr bootp; - uint8_t dhcp_options[1500]; + uint8_t dhcp_options[BOOTP_EXTS_SIZE]; struct iovec iov[] = { /* [0] = ip + udp header */ [1] = {&bootp, sizeof(struct bootp_hdr)}, diff --gi...
2008 Jun 14
2
PATCH: ipconfig may discard useful packets
.../kinit/ipconfig/dhcp_proto.c @@ -72,7 +72,7 @@ static struct iovec dhcp_request_iov[] = { /* * Parse a DHCP response packet * Returns: - * 0 = Not handled + * 0 = Unexpected packet, not parsed * 2 = DHCPOFFER (from dhcp_proto.h) * 5 = DHCPACK * 6 = DHCPNACK @@ -128,8 +128,8 @@ static int dhcp_parse(struct netdev *dev, struct bootp_hdr *hdr, /* * Receive and parse a DHCP packet * Returns: - *-1 = Error in packet_recv - * 0 = Not handled + *-1 = Error in packet_recv, try again later + * 0 = Unexpected packet, discarded * 2 = DHCPOFFER (from dhcp_proto.h) * 5 = DHCPACK * 6 = DHCPNACK...
2011 Jul 08
4
[PATCH 0/4] usr/kinit checkpatch
Various coding style fixes checkpatch warns about. The goal is not to be 100% checkpatch compliant, but to have more consistent coding style. As this is a trivial patch serie, will land in 24 hours in klibc git, unless of course ml review hits a bugger. Checked with size(3) that the generated kinit, fstype, ipconfig and nfsmount are the same. maximilian attems (4): [klibc] ipconfig: reduce