]> git.baikalelectronics.ru Git - kernel.git/commit
Staging: batman-adv: Keep header writable and unshared
authorSven Eckelmann <sven.eckelmann@gmx.de>
Sat, 4 Sep 2010 23:58:28 +0000 (01:58 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 5 Sep 2010 07:29:46 +0000 (00:29 -0700)
commit6bffd1b685a306a760189602ee4c61f6126336f0
treeb60e310ad8aa7dab31b2aef5fe5afcb3a14ae3f2
parent1a8015ed6a7d1d51f8b20419d73c6899103d5a6c
Staging: batman-adv: Keep header writable and unshared

my_skb_push provided an easy way to allocate enough headroom in
situation were we don't have enough space left and move the data pointer
to the new position, but we didn't checked wether we are allowed to
write to the new pushed header. This is for example a problem when the
skb was cloned and thus doesn't have a private data part.

my_skb_head_push now replaces my_skb_push by using skb_cow_head to
provide only a large enough, writable header without testing for the
rest of the (maybe shared) data. It will also move the data pointer
using skb_push when skb_cow_head doesn't fail.

This should give us enough flexibility in situation were skbs will be
queued by underlying layers and still doesn't unnecessarily copy the
data in situations when the skb was consumed right away during
dev_queue_xmit.

Reported-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/batman-adv/send.c
drivers/staging/batman-adv/soft-interface.c
drivers/staging/batman-adv/soft-interface.h
drivers/staging/batman-adv/unicast.c