click/string: clear dangling pointer on String::deref

In order to make use-after-free of Strings fail more quickly, this change
blows away _r.memo on String::deref(), since we should no longer hold a
reference to it.  Additionally, it asserts that the memo_t's refcount is not
zero when deref is invoked, since the caller should have a valid reference
at that point, and also that the refcount is zero when the memo_t is
deleted.
linuxmodule/FromDevice: replace assert with skb_share_check

It isn't clear that this assertion holds in general, so just Do the Right
Thing instead.  If the check returns NULL, the original SKB has already lost
a ref, so report that it was handled.
Whoopsy
CLP: Refuse to parse an option whose value has bad type

when the value was explicitly given.
CLP nit
Correct references to click-buildtool.
CoDel AQM implementation

CoDel implementation for AQM to mitigate bufferbloat. Drops packets from the queue based on the
sojourn time of the packet in the queue.
Searches the nearest upstream storage element first (eg Queue) and acts on that. If downstream
not found, then looks for the upstream element. It needs the "SetTimestamp" element prior
to the 'Queue', which sets the "first timestamp" annotation. CoDel then uses this annotation
to track the sojourn time, and then later overwrites it with the resulting sojourn time for
possible analysis thereafter.
Ref: http://queue.acm.org/detail.cfm?id=2209336

Signed-off-by: Apurv Bhartia <apurv@meraki.com>
Merge pull request #147 from apurvbhartia/aqm-codel

CoDel AQM implementation
elements/CoDel: convert from raw division to int_divide

The compiler was promoting some of the operations here to wider types.  This
meant that a kernel module with CoDel would fail to link against __divdi3.

Instead, use the helper functions in click/integers.hh

Signed-off-by: Derrick Pallas <pallas@meraki.com>
Merge pull request #148 from pallas/fix-codel-linuxmodule

elements/CoDel: convert from raw division to int_divide
NOACK value
Include packet_anno header

Needed for FIRST_TIMESTAMP_ANNO
16-bit txflags
Merge pull request #150 from bcronje/master

Include packet_anno header
Merge pull request #151 from larsbro/master

TXflags is 16 bit
Merge pull request #145 from pallas/fromdevice-skb-share-check

linuxmodule/FromDevice: replace assert with skb_share_check
Merge pull request #144 from pallas/dangling-string-memo

lib/string: clear dangling pointer on String::deref
clickfs/llrpc: make non-safe calls stop router threads

Previously, "safe" LLRPCs would take the read config lock and normal LLRPCs
would take the write config lock.  However, normal LLRPCs would not block
the router, meaning that shared data structures still needed to be protected
inside Elements.  This becomes extremely complicated if the Element needs to
push during the LLRPC or if a shared data structure needs to be accessed in
both atomic and non-atomic contexts.

This change makes normal LLRPCs also block the router.  The alternative was
to add an additional "exclusive" class of LLRPCs but it is hard to think of
an case where this call needs to be the only LLRPC+handler running but does
not also need to stop the router.

The only exception here is CALL_HANDLER, which will block based on whether
the handler itself is marked as exclusive or not.

Signed-off-by: Derrick Pallas <pallas@meraki.com>
click/llrpc: make some LLRPCs non-safe

These LLRPCs access IPRewriterBase::_map, which might be rehash()ed by a
router thread.  Therefore, make the LLRPC non-safe in order to block the
router.

Signed-off-by: Derrick Pallas <pallas@meraki.com>
Merge pull request #157 from pallas/non-safe-llrpc-should-block-router

Non-safe LLRPCs should block router