diff options
author | Sven Eckelmann <sven.eckelmann@gmx.de> | 2010-09-04 23:58:28 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-09-05 07:29:46 (GMT) |
commit | 99eed2842c4f67d1b9267173221441a48cd634a1 (patch) | |
tree | b60e310ad8aa7dab31b2aef5fe5afcb3a14ae3f2 /drivers/staging/batman-adv/soft-interface.h | |
parent | 15cf5523d2e42f755b3b1d8ea0fa601ffcf8b9e7 (diff) | |
download | linux-fsl-qoriq-99eed2842c4f67d1b9267173221441a48cd634a1.tar.xz |
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>
Diffstat (limited to 'drivers/staging/batman-adv/soft-interface.h')
-rw-r--r-- | drivers/staging/batman-adv/soft-interface.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/batman-adv/soft-interface.h b/drivers/staging/batman-adv/soft-interface.h index 6364854..9dbf5fc 100644 --- a/drivers/staging/batman-adv/soft-interface.h +++ b/drivers/staging/batman-adv/soft-interface.h @@ -26,7 +26,7 @@ void set_main_if_addr(uint8_t *addr); void interface_setup(struct net_device *dev); int interface_tx(struct sk_buff *skb, struct net_device *dev); void interface_rx(struct sk_buff *skb, int hdr_size); -int my_skb_push(struct sk_buff *skb, unsigned int len); +int my_skb_head_push(struct sk_buff *skb, unsigned int len); extern unsigned char main_if_addr[]; |