This is required on the Quanta platform, which needs to down a semaphore
inside the timeout implementation.
Also, add a 2.4 compatibility implementation of kthread so that both
2.4 and 2.6 can use the kthread API.
As a consequence, this fixes tests for multicast and local Ethernet
addresses, which formerly tested for the high bits but should
have tested for the low bits of the first octet.
- Removed BUG() call that could be maliciously/accidentally triggered by a faulty controller.
- Switched from __constant_htons to htons, which seems preferred.
The important part of this change is handling of IP options. The
rest is intended to ensure that packet->l3 and packet->l4 never
point outside the valid range of a packet in the presence of a
minimum-length Ethernet frame. Other code (particularly in forward.c)
assumes that if the IP protocol is TCP or UDP, then packet->l4 points
to a tcp_header or udp_header. Whether this is a good idea is
debatable--it probably warrants clean-up, at least--but that what's
there now.
Until now, vconn_connect() has always completed the connection
synchronously, blocking as necessary. In the userspace
switch, we want to be able to continue forwarding packets even
if the connection to the controller drops. Thus, this change set
that makes that possible.
The approach taken is perhaps more ambitious than needed, as it
actually adds a new high-level mechanism for polling on arbitrary
file descriptors. This necessitates quite a bit of change to
each of the userspace programs that use vconns, but it also has
the effect of simplifying them. The new structure of these programs
is a lot less fragile than the old one (which tended to end up
livelocking or hanging when something wasn't quite right), so it
seems like the changes are worth it.
1024-bit Diffie-Hellman is somewhat weak, but I haven't been able to
figure out how to make OpenSSL use longer Diffie-Hellman keys than that.
If this isn't available, OpenSSL doesn't let connections proceed.
This change should be reverted when we figure out how to make OpenSSL
use longer Diffie-Hellman keys.
This means that adding logging to code disturbs the program's state
as little as possible. This is a precautionary measure, not in response
to any particular bug.