search for: dhcp_recv

Displaying 8 results from an estimated 8 matches for "dhcp_recv".

2009 Jan 15
1
Bug#511959: klibc-utils: ipconfig times out when several machines boot at the very same time
...goto free_pkt; | ? | free_pkt: | free(ip); | return 0; | ? Which means in case of source/dest mismatch (which is the case when a message from another client is received), 0 is returned. Now, looking at the callers: bootp_proto.c: bootp_recv_reply() & dhcp_proto.c: dhcp_recv() | ? | ret = packet_recv(iov, 3); | if (ret <= 0) | return ret; | ? Again, 0 is returned. dhcp_recv() is wrapped into dhcp_recv_offer() & dhcp_recv_ack(). Finally, all those are used in switch() statements in main.c, where -1 and strictly positive values a...
2008 Jun 14
2
PATCH: ipconfig may discard useful packets
...look at the code or extra testing may be needed. A scenario where the bug occurs: In main.c: nr = do_pkt_recv(pkt_fd, now.tv_sec); if (nr == 1) break; else if (nr == 0) packet_discard(); <== This one The following functions may be called: do_pkt_recv > process_receive_event > e.g. dhcp_recv_offer > dhcp_recv > packet_recv packet_recv may receive a not-appropriate packet, and jump to discard_pkt, in which case it *discards* the packet and returns 0. This return value (0) will propagate to main, so (nr == 0) and packet_discard() will be called *again*, causing the NIC to wait unt...
2009 Apr 07
2
[PATCH] ipconfig: send hostname in DHCP request
...st_hdr, sizeof(dhcp_request_hdr)}, [3] = {dhcp_params, sizeof(dhcp_params)}, - /* [4] = DHCP vendor class */ - [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...
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
2012 May 22
0
[klibc:master] ipconfig: Write $DOMAINSEARCH as domain-search
...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 --git a/usr/kinit/ipconfig/main.c b/usr/kinit/ipconfig/main.c index 1...
2011 Mar 27
4
ipconfig problem if multiple devices are up
Hi, it seems that ipconfig has a problem if multiple devices are up and connected to the same network. It seems that it uses the wrong socket/device index to compare it to incoming packet. To be more precise, the packet gets discarded in do_pkt_recv as the ifindex from state differs always from the incoming packet To reproduce create two tap devices: $ sudo tunctl -u uli -t tap0
2010 Aug 25
0
[patch] ipconfig fixes + run-init nit
...< 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) int ret; ret = packet_recv(iov, 3); - if (ret == 0) - return -1; + if (ret <= 0) + return ret; dprintf("\n dhcp xid %08x ", dev->bootp.xid); diff --git a/usr/kinit/ipconfig/packet.c b/usr/kinit/ipconfig/packet.c index d242457..84267b7 100644 --- a...
2011 Mar 28
5
[PATCH 1/3] Only peek and discard packets from specified device.
...recv(iov, 3); + ret = packet_recv(dev, iov, 3); if (ret <= 0) return ret; diff --git a/usr/kinit/ipconfig/dhcp_proto.c b/usr/kinit/ipconfig/dhcp_proto.c index fc0494d..993db52 100644 --- a/usr/kinit/ipconfig/dhcp_proto.c +++ b/usr/kinit/ipconfig/dhcp_proto.c @@ -147,7 +147,7 @@ static int dhcp_recv(struct netdev *dev) }; int ret; - ret = packet_recv(iov, 3); + ret = packet_recv(dev, iov, 3); if (ret <= 0) return ret; diff --git a/usr/kinit/ipconfig/main.c b/usr/kinit/ipconfig/main.c index d501bec..1e48083 100644 --- a/usr/kinit/ipconfig/main.c +++ b/usr/kinit/ipconfig/main.c @...