提交 83c758fa 编写于 作者: S Stephen Hemminger 提交者: Jeff Garzik

[PATCH] skge: use dev_alloc_skb

To avoid problems with buggy protocols that assume extra header space,
use dev_alloc_skb() when allocating receive buffers.
Signed-off-by: NStephen Hemminger <shemminger@osdl.org>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 78bc2186
...@@ -827,7 +827,8 @@ static int skge_rx_fill(struct skge_port *skge) ...@@ -827,7 +827,8 @@ static int skge_rx_fill(struct skge_port *skge)
do { do {
struct sk_buff *skb; struct sk_buff *skb;
skb = alloc_skb(skge->rx_buf_size + NET_IP_ALIGN, GFP_KERNEL); skb = __dev_alloc_skb(skge->rx_buf_size + NET_IP_ALIGN,
GFP_KERNEL);
if (!skb) if (!skb)
return -ENOMEM; return -ENOMEM;
...@@ -2609,7 +2610,7 @@ static inline struct sk_buff *skge_rx_get(struct skge_port *skge, ...@@ -2609,7 +2610,7 @@ static inline struct sk_buff *skge_rx_get(struct skge_port *skge,
goto error; goto error;
if (len < RX_COPY_THRESHOLD) { if (len < RX_COPY_THRESHOLD) {
skb = alloc_skb(len + 2, GFP_ATOMIC); skb = dev_alloc_skb(len + 2);
if (!skb) if (!skb)
goto resubmit; goto resubmit;
...@@ -2624,7 +2625,7 @@ static inline struct sk_buff *skge_rx_get(struct skge_port *skge, ...@@ -2624,7 +2625,7 @@ static inline struct sk_buff *skge_rx_get(struct skge_port *skge,
skge_rx_reuse(e, skge->rx_buf_size); skge_rx_reuse(e, skge->rx_buf_size);
} else { } else {
struct sk_buff *nskb; struct sk_buff *nskb;
nskb = alloc_skb(skge->rx_buf_size + NET_IP_ALIGN, GFP_ATOMIC); nskb = dev_alloc_skb(skge->rx_buf_size + NET_IP_ALIGN);
if (!nskb) if (!nskb)
goto resubmit; goto resubmit;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册