@@ -2485,19 +2485,19 @@ int skb_send_sock_locked(struct sock *sk, struct sk_buff *skb, int offset,
24852485 for (fragidx = 0 ; fragidx < skb_shinfo (skb )-> nr_frags ; fragidx ++ ) {
24862486 skb_frag_t * frag = & skb_shinfo (skb )-> frags [fragidx ];
24872487
2488- if (offset < frag -> size )
2488+ if (offset < skb_frag_size ( frag ) )
24892489 break ;
24902490
2491- offset -= frag -> size ;
2491+ offset -= skb_frag_size ( frag ) ;
24922492 }
24932493
24942494 for (; len && fragidx < skb_shinfo (skb )-> nr_frags ; fragidx ++ ) {
24952495 skb_frag_t * frag = & skb_shinfo (skb )-> frags [fragidx ];
24962496
2497- slen = min_t (size_t , len , frag -> size - offset );
2497+ slen = min_t (size_t , len , skb_frag_size ( frag ) - offset );
24982498
24992499 while (slen ) {
2500- ret = kernel_sendpage_locked (sk , frag -> page . p ,
2500+ ret = kernel_sendpage_locked (sk , skb_frag_page ( frag ) ,
25012501 frag -> page_offset + offset ,
25022502 slen , MSG_DONTWAIT );
25032503 if (ret <= 0 )
@@ -2975,11 +2975,15 @@ skb_zerocopy(struct sk_buff *to, struct sk_buff *from, int len, int hlen)
29752975 skb_zerocopy_clone (to , from , GFP_ATOMIC );
29762976
29772977 for (i = 0 ; i < skb_shinfo (from )-> nr_frags ; i ++ ) {
2978+ int size ;
2979+
29782980 if (!len )
29792981 break ;
29802982 skb_shinfo (to )-> frags [j ] = skb_shinfo (from )-> frags [i ];
2981- skb_shinfo (to )-> frags [j ].size = min_t (int , skb_shinfo (to )-> frags [j ].size , len );
2982- len -= skb_shinfo (to )-> frags [j ].size ;
2983+ size = min_t (int , skb_frag_size (& skb_shinfo (to )-> frags [j ]),
2984+ len );
2985+ skb_frag_size_set (& skb_shinfo (to )-> frags [j ], size );
2986+ len -= size ;
29832987 skb_frag_ref (to , j );
29842988 j ++ ;
29852989 }
@@ -3293,7 +3297,7 @@ static int skb_prepare_for_shift(struct sk_buff *skb)
32933297int skb_shift (struct sk_buff * tgt , struct sk_buff * skb , int shiftlen )
32943298{
32953299 int from , to , merge , todo ;
3296- struct skb_frag_struct * fragfrom , * fragto ;
3300+ skb_frag_t * fragfrom , * fragto ;
32973301
32983302 BUG_ON (shiftlen > skb -> len );
32993303
@@ -3625,10 +3629,10 @@ static inline skb_frag_t skb_head_frag_to_page_desc(struct sk_buff *frag_skb)
36253629 struct page * page ;
36263630
36273631 page = virt_to_head_page (frag_skb -> head );
3628- head_frag . page . p = page ;
3632+ __skb_frag_set_page ( & head_frag , page ) ;
36293633 head_frag .page_offset = frag_skb -> data -
36303634 (unsigned char * )page_address (page );
3631- head_frag . size = skb_headlen (frag_skb );
3635+ skb_frag_size_set ( & head_frag , skb_headlen (frag_skb ) );
36323636 return head_frag ;
36333637}
36343638
@@ -4021,7 +4025,7 @@ int skb_gro_receive(struct sk_buff *p, struct sk_buff *skb)
40214025
40224026 pinfo -> nr_frags = nr_frags + 1 + skbinfo -> nr_frags ;
40234027
4024- frag -> page . p = page ;
4028+ __skb_frag_set_page ( frag , page ) ;
40254029 frag -> page_offset = first_offset ;
40264030 skb_frag_size_set (frag , first_size );
40274031
0 commit comments