Displaying 3 results from an estimated 3 matches for "process_timeout_ev".
2003 Apr 29
0
[PATCH] Fix busy-looping behaviour in ipconfig
...int handled = 1;
+
switch (s->state) {
case DEVST_BOOTP:
s->restart_state = DEVST_BOOTP;
@@ -173,8 +181,12 @@
case DEVST_ERROR:
/* error occurred, try again in 10 seconds */
s->expire = now + 10;
+ default:
+ handled = 0;
break;
}
+
+ return handled;
}
static void process_timeout_event(struct state *s, time_t now)
@@ -231,20 +243,23 @@
static struct state *slist;
-static void do_pkt_recv(int pkt_fd, time_t now)
+static int do_pkt_recv(int pkt_fd, time_t now)
{
int ifindex, ret;
struct state *s;
ret = packet_peek(&ifindex);
if (ret < 0)
- return;
+ goto...
2011 Jul 18
2
ipconfig:About the length of 'options' field of DHCP packet
....c b/usr/kinit/ipconfig/bootp_proto.c
index f2cc90c..19c61ef 100644
--- a/usr/kinit/ipconfig/bootp_proto.c
+++ b/usr/kinit/ipconfig/bootp_proto.c
@@ -212,5 +212,11 @@ int bootp_init_if(struct netdev *dev)
dev->bootp.xid = (uint32_t) lrand48();
dev->open_time = time(NULL);
+ /*
+ * 'process_timeout_event(main.c)' will increment 'fail_count'
+ * only once independent of a failure.
+ */
+ dev->bootp.fail_count = ~0;
+
return 0;
}
diff --git a/usr/kinit/ipconfig/dhcp_proto.c b/usr/kinit/ipconfig/dhcp_proto.c
index afd2eca..91dd695 100644
--- a/usr/kinit/ipconfig/dhcp_proto.c
+++...
2008 Jun 14
2
PATCH: ipconfig may discard useful packets
...(s->state) {
@@ -224,9 +233,6 @@ static int process_receive_event(struct state *s,
time_t now)
case DEVST_ERROR:
/* error occurred, try again in 10 seconds */
s->expire = now + 10;
- default:
- DEBUG(("\n"));
- handled = 0;
break;
}
@@ -288,23 +294,30 @@ static void process_timeout_event(struct state
*s, time_t now)
static struct state *slist;
struct netdev *ifaces;
+/*
+ * Returns:
+ * 0 = Error, packet not received or discarded
+ * 1 = A packet was received and handled
+ */
static int do_pkt_recv(int pkt_fd, time_t now)
{
int ifindex, ret;
struct state *s;
ret =...