[Click] unsafe write in dequeue.cc, problem with Packet::shift_data

Ulf Hermann uhermann at informatik.hu-berlin.de
Thu Jun 19 03:56:34 EDT 2008


>
> - The misbehavior you report with Packet::shift_data() was still
> present in our current code.  I addressed this in a different way --
> making a copy on EVERY shift seems extreme, and copying all headroom
> and tailroom seems unnecessary.  Instead, the current code ensures
> that any mac_header() data is preserved.  Would this help?
I don't think so. There might be other interesting bits in the headroom
even before the MAC header. For example we have a "wifi_extra" header
there which shouldn't be overwritten. And I do funny things with
multiple MAC headers in the same headroom, which are switched around as
needed. But you could argue that I'm misusing the headroom then. So,
perhaps make an annotation that tells how much headroom is actually
occupied? On the other hand, that's also a hack because when using the
packet class you shouldn't need to care about the amount of headroom to
be shifted around. Perhaps some "layered" head- and tailroom, where part
of it is really unused buffer area and part of it is occupied by various
headers would be better.

I don't really know how to solve that in the "right" way, that's why I
took those extreme measures to ensure everything works.

Ulf


More information about the click mailing list