V1.1, 24-FEB-2008

Fix compiler optimisation issues when compiled with recent gcc-4.x
compilers. Modern gcc can aggressively reorder instructions and even
functions. In the case of USL list operations, this can cause code to
be executed the wrong side of list add/remove which results in
corrupted lists or timing issues. The problem can show itself by
openl2tpd hanging while walking lists, but other random crashes could
also occur. The fix is to use memory barriers in the low level USL
list operations.

Initialize the random seed using a value from /dev/urandom at startup
so that the assigned tunnel_id / session_id values have better
randomness. (We used to use /dev/urandom directly for all random ids
rather than libc's random() call but we switched to random() when it
was found that stress testing could cause reads to /dev/urandom to
block due to the system's entropy pool being exhausted in extreme load
conditions.) Using /dev/urandom to init the random seed is a good

Fix pppd plugin to always call the ip up/down hooks to send status
back to openl2tpd, regardless of whether pppol2tp_ifname was
specified. Previously, the hooks were only needed when the interface
name wasn't specified because we used the event to discover the ppp
interface name in openl2tpd. But these hooks are now used to stop the
session's ppp setup timer so we always need them. This bug was
introduced in 1.0 and was reported by Iouri Kharon.

Minor improvements to debian startup script.

Apply several fixes from Ben McKeegan:
- Fix ppp_unix plugin to prevent "active pppd count gone negative" error
  messages. This bug could cause the daemon to segfault when lots of PPP
  sessions were present.
- Fix a bug in the transmit queue code which could crash the daemon if a
  ZLB ever found its way onto the packet queue.
- Fix uninitialised variable bug in USL's child pid handling
  code. This could cause an openl2tpd crash on a heavily loaded system.
- Fix a buffer overrun bug in the CLI code if l2tpconfig is connected
  to a remote openl2tpd.

Fix errors found with valgrind:
- Incorrect checks for valid fd before close() calls in several places.
- Possible buffer overrun when storing result_code AVP data from peer.
- Fix uninitialised data errors in struct sockaddr structures. While
  these specific valgrind errors are bogus, it is useful to fix the
  code to get rid of the valgrind complaints.

Turn off compiler warnings when compiling rpcgen code.