skb_put() 增长数据区的长度来为memcpy准备空间. 许多的网络操作需要加入一些桢头, 这可以使用skb_push来将数据区向后推, 为头留出空间.
请参见下图:
----------------------------------------
| head | data | |
----------------------------------------
skb_put
-----------------------------------------
| head | data | put_data | |
-----------------------------------------
skb_push
------------------------------------------
| head | push_data | data | put_data | |
------------------------------------------
请参见下图:
----------------------------------------
| head | data | |
----------------------------------------
skb_put
-----------------------------------------
| head | data | put_data | |
-----------------------------------------
skb_push
------------------------------------------
| head | push_data | data | put_data | |
------------------------------------------