aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/freescale/fec_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/freescale/fec_main.c')
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 38d9d276ab8b..77037fd377b8 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -320,6 +320,11 @@ static void *swap_buffer(void *bufaddr, int len)
320 return bufaddr; 320 return bufaddr;
321} 321}
322 322
323static inline bool is_ipv4_pkt(struct sk_buff *skb)
324{
325 return skb->protocol == htons(ETH_P_IP) && ip_hdr(skb)->version == 4;
326}
327
323static int 328static int
324fec_enet_clear_csum(struct sk_buff *skb, struct net_device *ndev) 329fec_enet_clear_csum(struct sk_buff *skb, struct net_device *ndev)
325{ 330{
@@ -330,7 +335,8 @@ fec_enet_clear_csum(struct sk_buff *skb, struct net_device *ndev)
330 if (unlikely(skb_cow_head(skb, 0))) 335 if (unlikely(skb_cow_head(skb, 0)))
331 return -1; 336 return -1;
332 337
333 ip_hdr(skb)->check = 0; 338 if (is_ipv4_pkt(skb))
339 ip_hdr(skb)->check = 0;
334 *(__sum16 *)(skb->head + skb->csum_start + skb->csum_offset) = 0; 340 *(__sum16 *)(skb->head + skb->csum_start + skb->csum_offset) = 0;
335 341
336 return 0; 342 return 0;