Update of /cvsroot/dhcp-agent/dhcp-agent
In directory usw-pr-cvs1:/tmp/cvs-serv30141
Modified Files:
TODO dhcp-agent.h dhcp-net.c
Log Message:
quick hack to get around OpenBSD bpf_timeval issue
Index: TODO
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/TODO,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** TODO 3 Jun 2002 01:36:04 -0000 1.18
--- TODO 5 Jun 2002 13:08:36 -0000 1.19
***************
*** 15,18 ****
--- 15,21 ----
other todo:
+ -- autoconf script is getting ugly -- methinks its broken and is
+ barely parsed
+
-- add test for kill(0, pid) to see if it correctly identifies the
running process.
Index: dhcp-agent.h
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-agent.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** dhcp-agent.h 5 Jun 2002 12:59:58 -0000 1.46
--- dhcp-agent.h 5 Jun 2002 13:08:36 -0000 1.47
***************
*** 289,297 ****
int packet_len; /* total length of packet. */
- #ifdef HAVE_BPF_TIMEVAL
- struct bpf_timeval tstamp /* timestamp. */
- #else
struct timeval tstamp; /* timestamp. */
- #endif
eth_addr_t hw_addr; /* our hardware address. */
--- 289,293 ----
Index: dhcp-net.c
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-net.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** dhcp-net.c 3 Jun 2002 22:40:32 -0000 1.23
--- dhcp-net.c 5 Jun 2002 13:08:36 -0000 1.24
***************
*** 414,419 ****
/* Set timestamp. */
net->tstamp = pkthdr.ts;
!
/* Read ethernet header and switch on type. *
* Fails if malformed or insufficient length. */
--- 414,441 ----
/* Set timestamp. */
+ #if defined(HAVE_BPF_TIMEVAL)
+
+ /* This is an ugly hack -- why oh why did OpenBSD insist on
+ * creating its own bpf_timeval struct with unsigned values
+ * as opposed to the common UNIX timeval which has signed values.
+ *
+ *
+ * *sigh*
+ *
+ * There really isn't any clean way around this apart from grabbing
+ * our own timestamp instead of using the bpf one. This is inaccurate
+ * but until OpenBSD fixes their braindamage they'll just have to
+ * deal with the inaccuracy. Anything else would be too damaging
+ * to the other UNIX flavors.
+ */
+
+ gettimeofday(&net->tstamp, NULL);
+
+ #else /* HAVE_BPF_TIMEVAL */
+
net->tstamp = pkthdr.ts;
!
! #endif /* HAVE_BPF_TIMEVAL */
!
/* Read ethernet header and switch on type. *
* Fails if malformed or insufficient length. */
|