ofpbuf: Implement unsupported feature in ofpbuf_trim().
Until now, ofpbuf_trim() has not handled the case where the ofpbuf has
nonzero headroom. This causes an assertion failure when pinsched_send()
queues a packet to be sent later, because such packets have been
guaranteed to have nonzero headroom since commit
43253595 "ofproto: Avoid
buffer copy in OFPT_PACKET_IN path." This commit fixes the problem by
implementing the until-now unsupported case.
This commit factors code out of ofpbuf_prealloc_tailroom() into two new
functions, ofpbuf_rebase__() and ofpbuf_resize_tailroom__(), and uses the
latter to implement both ofpbuf_prealloc_tailroom() and ofpbuf_trim().
ofpbuf_rebase__() isn't used on its own at all, but it seems potentially
useful so I made it an independent function.
Reported-by: Tom Everman <teverman@google.com>