提交 b765e84f 编写于 作者: R Rémi Denis-Courmont 提交者: David S. Miller

Phonet: return an error when packet TX fails

Phonet assumes that packets are never dropped. We try our best to
avoid this situation. But lets return ENOBUFS if queueing to the
network device fails so that the caller knows things went wrong.
Signed-off-by: NRémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c69d4407
...@@ -195,11 +195,7 @@ static int pn_send(struct sk_buff *skb, struct net_device *dev, ...@@ -195,11 +195,7 @@ static int pn_send(struct sk_buff *skb, struct net_device *dev,
if (skb->pkt_type == PACKET_LOOPBACK) { if (skb->pkt_type == PACKET_LOOPBACK) {
skb_reset_mac_header(skb); skb_reset_mac_header(skb);
skb_orphan(skb); skb_orphan(skb);
if (irq) err = (irq ? netif_rx(skb) : netif_rx_ni(skb)) ? -ENOBUFS : 0;
netif_rx(skb);
else
netif_rx_ni(skb);
err = 0;
} else { } else {
err = dev_hard_header(skb, dev, ntohs(skb->protocol), err = dev_hard_header(skb, dev, ntohs(skb->protocol),
NULL, NULL, skb->len); NULL, NULL, skb->len);
...@@ -208,6 +204,8 @@ static int pn_send(struct sk_buff *skb, struct net_device *dev, ...@@ -208,6 +204,8 @@ static int pn_send(struct sk_buff *skb, struct net_device *dev,
goto drop; goto drop;
} }
err = dev_queue_xmit(skb); err = dev_queue_xmit(skb);
if (unlikely(err > 0))
err = net_xmit_errno(err);
} }
return err; return err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册