aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index a59d9343c25b..6c8b6f604e76 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -557,7 +557,9 @@ struct sk_buff {
557 /* fields enclosed in headers_start/headers_end are copied 557 /* fields enclosed in headers_start/headers_end are copied
558 * using a single memcpy() in __copy_skb_header() 558 * using a single memcpy() in __copy_skb_header()
559 */ 559 */
560 /* private: */
560 __u32 headers_start[0]; 561 __u32 headers_start[0];
562 /* public: */
561 563
562/* if you move pkt_type around you also must adapt those constants */ 564/* if you move pkt_type around you also must adapt those constants */
563#ifdef __BIG_ENDIAN_BITFIELD 565#ifdef __BIG_ENDIAN_BITFIELD
@@ -642,7 +644,9 @@ struct sk_buff {
642 __u16 network_header; 644 __u16 network_header;
643 __u16 mac_header; 645 __u16 mac_header;
644 646
647 /* private: */
645 __u32 headers_end[0]; 648 __u32 headers_end[0];
649 /* public: */
646 650
647 /* These elements must be at the end, see alloc_skb() for details. */ 651 /* These elements must be at the end, see alloc_skb() for details. */
648 sk_buff_data_t tail; 652 sk_buff_data_t tail;
@@ -795,15 +799,19 @@ struct sk_buff_fclones {
795 * @skb: buffer 799 * @skb: buffer
796 * 800 *
797 * Returns true is skb is a fast clone, and its clone is not freed. 801 * Returns true is skb is a fast clone, and its clone is not freed.
802 * Some drivers call skb_orphan() in their ndo_start_xmit(),
803 * so we also check that this didnt happen.
798 */ 804 */
799static inline bool skb_fclone_busy(const struct sk_buff *skb) 805static inline bool skb_fclone_busy(const struct sock *sk,
806 const struct sk_buff *skb)
800{ 807{
801 const struct sk_buff_fclones *fclones; 808 const struct sk_buff_fclones *fclones;
802 809
803 fclones = container_of(skb, struct sk_buff_fclones, skb1); 810 fclones = container_of(skb, struct sk_buff_fclones, skb1);
804 811
805 return skb->fclone == SKB_FCLONE_ORIG && 812 return skb->fclone == SKB_FCLONE_ORIG &&
806 fclones->skb2.fclone == SKB_FCLONE_CLONE; 813 fclones->skb2.fclone == SKB_FCLONE_CLONE &&
814 fclones->skb2.sk == sk;
807} 815}
808 816
809static inline struct sk_buff *alloc_skb_fclone(unsigned int size, 817static inline struct sk_buff *alloc_skb_fclone(unsigned int size,