search for: bootp_hdr

Displaying 17 results from an estimated 17 matches for "bootp_hdr".

2012 May 22
0
[klibc:master] ipconfig: Write $DOMAINSEARCH as domain-search
...fig/netdev.h | 1 + 5 files changed, 253 insertions(+), 3 deletions(-) diff --git a/usr/kinit/ipconfig/bootp_packet.h b/usr/kinit/ipconfig/bootp_packet.h index 6016e5f..1ef505e 100644 --- a/usr/kinit/ipconfig/bootp_packet.h +++ b/usr/kinit/ipconfig/bootp_packet.h @@ -28,4 +28,14 @@ struct bootp_hdr { /* 312 bytes of extensions */ }; +/* + * memory size of BOOTP Vendor Extensions/DHCP Options for receiving + * + * generic_ether_mtu:1500, min_sizeof(ip_hdr):20, sizeof(udp_hdr):8 + * + * #define BOOTP_EXTS_SIZE (1500 - 20 - 8 - sizeof(struct bootp_hdr)) + */ +/* larger size for backward com...
2012 May 22
0
[klibc:master] ipconfig: Append padding if DHCP packet length < 300 octets
...c | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletions(-) diff --git a/usr/kinit/ipconfig/bootp_packet.h b/usr/kinit/ipconfig/bootp_packet.h index 1ef505e..1d5bd0d 100644 --- a/usr/kinit/ipconfig/bootp_packet.h +++ b/usr/kinit/ipconfig/bootp_packet.h @@ -38,4 +38,7 @@ struct bootp_hdr { /* larger size for backward compatibility of ipconfig */ #define BOOTP_EXTS_SIZE 1500 +/* minimum length of BOOTP/DHCP packet on sending */ +#define BOOTP_MIN_LEN 300 + #endif /* BOOTP_PACKET_H */ diff --git a/usr/kinit/ipconfig/dhcp_proto.c b/usr/kinit/ipconfig/dhcp_proto.c index 0c907e9..e...
2009 Apr 07
2
[PATCH] ipconfig: send hostname in DHCP request
...lass */ - [5] = {dhcp_end, sizeof(dhcp_end)} + /* [4] = optional vendor class */ + /* [5] = optional hostname */ + /* [6] = {dhcp_end, sizeof(dhcp_end)} */ }; /* @@ -164,6 +166,8 @@ static int dhcp_recv(struct netdev *dev) static int dhcp_send(struct netdev *dev, struct iovec *vec) { struct bootp_hdr bootp; + char dhcp_hostname[SYS_NMLN+2]; + int i = 4; memset(&bootp, 0, sizeof(struct bootp_hdr)); @@ -179,12 +183,35 @@ static int dhcp_send(struct netdev *dev, struct iovec *vec) vec[1].iov_base = &bootp; vec[1].iov_len = sizeof(struct bootp_hdr); - vec[4].iov_base = vendor_cl...
2025 Feb 15
1
[PATCH] ipconfig: align reads of ext for sparc64
...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); + leasetime = ntohl(leasetime); + }...
2011 Jul 18
2
ipconfig:About the length of 'options' field of DHCP packet
...static struct iovec dhcp_request_iov[DHCP_IOV_LEN] = { /* [4] = optional vendor class */ /* [5] = optional hostname */ /* [6] = {dhcp_end, sizeof(dhcp_end)} */ + /* [7] = optional padding */ }; /* @@ -167,6 +169,7 @@ static int dhcp_send(struct netdev *dev, struct iovec *vec) { struct bootp_hdr bootp; char dhcp_hostname[SYS_NMLN+2]; + uint8_t options_padding[64]; int i = 4; memset(&bootp, 0, sizeof(struct bootp_hdr)); @@ -212,6 +215,25 @@ static int dhcp_send(struct netdev *dev, struct iovec *vec) vec[i].iov_base = dhcp_end; vec[i].iov_len = sizeof(dhcp_end); + + if(dev...
2017 Dec 19
0
[PATCH] Implement classless static routes
...dth = netmask_width; + route->next = NULL; + + if (prev_route == NULL) { + routes = route; + } else { + prev_route->next = route; + } + prev_route = route; + } + return routes; +} + /* * Parse a bootp reply packet */ @@ -275,6 +356,8 @@ int bootp_parse(struct netdev *dev, struct bootp_hdr *hdr, { uint8_t ext119_buf[BOOTP_EXTS_SIZE]; int16_t ext119_len = 0; + uint8_t ext121_buf[BOOTP_EXTS_SIZE]; + int16_t ext121_len = 0; dev->bootp.gateway = hdr->giaddr; dev->ip_addr = hdr->yiaddr; @@ -367,6 +450,16 @@ int bootp_parse(struct netdev *dev, struct bootp_hdr *hdr,...
2008 Jun 14
2
PATCH: ipconfig may discard useful packets
...es changed, 43 insertions(+), 20 deletions(-) diff --git a/usr/kinit/ipconfig/bootp_proto.c b/usr/kinit/ipconfig/bootp_proto.c index 236bde9..7df3137 100644 --- a/usr/kinit/ipconfig/bootp_proto.c +++ b/usr/kinit/ipconfig/bootp_proto.c @@ -153,6 +153,10 @@ int bootp_parse(struct netdev *dev, struct bootp_hdr *hdr, /* * Receive a bootp reply and parse packet + * Returns: + *-1 = Error in packet_recv, try again later + * 0 = Unexpected packet, discarded + * 1 = Correctly received and parsed packet */ int bootp_recv_reply(struct netdev *dev) { @@ -167,7 +171,7 @@ int bootp_recv_reply(struct netdev...
2018 Jun 12
0
[PATCH v2] Implement classless static routes
...dth = netmask_width; + route->next = NULL; + + if (prev_route == NULL) { + routes = route; + } else { + prev_route->next = route; + } + prev_route = route; + } + return routes; +} + /* * Parse a bootp reply packet */ @@ -275,6 +356,8 @@ int bootp_parse(struct netdev *dev, struct bootp_hdr *hdr, { uint8_t ext119_buf[BOOTP_EXTS_SIZE]; int16_t ext119_len = 0; + uint8_t ext121_buf[BOOTP_EXTS_SIZE]; + int16_t ext121_len = 0; dev->bootp.gateway = hdr->giaddr; dev->ip_addr = hdr->yiaddr; @@ -367,6 +450,16 @@ int bootp_parse(struct netdev *dev, struct bootp_hdr *hdr,...
2019 Jan 18
0
[klibc:master] ipconfig: Implement classless static routes
...dth = netmask_width; + route->next = NULL; + + if (prev_route == NULL) { + routes = route; + } else { + prev_route->next = route; + } + prev_route = route; + } + return routes; +} + /* * Parse a bootp reply packet */ @@ -275,6 +356,8 @@ int bootp_parse(struct netdev *dev, struct bootp_hdr *hdr, { uint8_t ext119_buf[BOOTP_EXTS_SIZE]; int16_t ext119_len = 0; + uint8_t ext121_buf[BOOTP_EXTS_SIZE]; + int16_t ext121_len = 0; dev->bootp.gateway = hdr->giaddr; dev->ip_addr = hdr->yiaddr; @@ -367,6 +450,16 @@ int bootp_parse(struct netdev *dev, struct bootp_hdr *hdr,...
2018 Jun 18
1
[PATCH v3 1/2] Implement classless static routes
...dth = netmask_width; + route->next = NULL; + + if (prev_route == NULL) { + routes = route; + } else { + prev_route->next = route; + } + prev_route = route; + } + return routes; +} + /* * Parse a bootp reply packet */ @@ -275,6 +356,8 @@ int bootp_parse(struct netdev *dev, struct bootp_hdr *hdr, { uint8_t ext119_buf[BOOTP_EXTS_SIZE]; int16_t ext119_len = 0; + uint8_t ext121_buf[BOOTP_EXTS_SIZE]; + int16_t ext121_len = 0; dev->bootp.gateway = hdr->giaddr; dev->ip_addr = hdr->yiaddr; @@ -367,6 +450,16 @@ int bootp_parse(struct netdev *dev, struct bootp_hdr *hdr,...
2025 Feb 28
0
[PATCH] ipconfig: align reads of ext for RISC architectures
...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); + leasetime = ntohl(leasetime); + }...
2025 Feb 28
1
[PATCH v2] ipconfig: align reads of ext for RISC architectures
...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); + leasetime = ntohl(leasetime); + }...
2008 Jun 14
5
PATCH: ipconfig may accept DHCPOFFER as DHCPACK
Hello, I found a bug in ipconfig and I'm sending a proposed patch for it. I've only seen it happen in 2 dhcp-server 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
2010 Aug 25
0
[patch] ipconfig fixes + run-init nit
...config/bootp_proto.c index 42dfad3..baf9d3e 100644 --- a/usr/kinit/ipconfig/bootp_proto.c +++ b/usr/kinit/ipconfig/bootp_proto.c @@ -171,7 +171,7 @@ int bootp_recv_reply(struct netdev *dev) ret = packet_recv(iov, 3); if (ret <= 0) - return -1; + return ret; if (ret < sizeof(struct bootp_hdr) || bootp.op != BOOTP_REPLY || /* RFC951 7.5 */ diff --git a/usr/kinit/ipconfig/dhcp_proto.c b/usr/kinit/ipconfig/dhcp_proto.c index 2a2651a..fc0494d 100644 --- a/usr/kinit/ipconfig/dhcp_proto.c +++ b/usr/kinit/ipconfig/dhcp_proto.c @@ -148,8 +148,8 @@ static int dhcp_recv(struct netdev *dev)...
2010 Apr 25
2
[git pull] small fixes, sh4, getruage() README's
...r stylistic fix Signed-off-by: maximilian attems <max at stro.at> diff --git a/usr/kinit/ipconfig/bootp_packet.h b/usr/kinit/ipconfig/bootp_packet.h index 3525ec3..6016e5f 100644 --- a/usr/kinit/ipconfig/bootp_packet.h +++ b/usr/kinit/ipconfig/bootp_packet.h @@ -28,4 +28,4 @@ struct bootp_hdr { /* 312 bytes of extensions */ }; -#endif +#endif /* BOOTP_PACKET_H */ commit 7416d9a51082b9ecd322d71bd2f96597195e141a Author: maximilian attems <max at stro.at> Date: Mon Apr 5 04:18:09 2010 +0200 [klibc] resume: silence warning on resume try We most propably didn'...
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
2010 Jul 07
0
[git pull v2] x86_32, sh4, getrusage()
...r stylistic fix Signed-off-by: maximilian attems <max at stro.at> diff --git a/usr/kinit/ipconfig/bootp_packet.h b/usr/kinit/ipconfig/bootp_packet.h index 3525ec3..6016e5f 100644 --- a/usr/kinit/ipconfig/bootp_packet.h +++ b/usr/kinit/ipconfig/bootp_packet.h @@ -28,4 +28,4 @@ struct bootp_hdr { /* 312 bytes of extensions */ }; -#endif +#endif /* BOOTP_PACKET_H */ commit f0edd251485dcb3111466307ca8d9c9d74467b19 Author: maximilian attems <max at stro.at> Date: Mon Apr 5 04:18:09 2010 +0200 [klibc] resume: silence warning on resume try We most propably didn'...