aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firewire/net.c')
-rw-r--r--drivers/firewire/net.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
index c1898adeb900..d438c5be8c21 100644
--- a/drivers/firewire/net.c
+++ b/drivers/firewire/net.c
@@ -517,6 +517,14 @@ static int fwnet_finish_incoming_packet(struct net_device *net,
517 int status; 517 int status;
518 __be64 guid; 518 __be64 guid;
519 519
520 switch (ether_type) {
521 case ETH_P_ARP:
522 case ETH_P_IP:
523 break;
524 default:
525 goto err;
526 }
527
520 dev = netdev_priv(net); 528 dev = netdev_priv(net);
521 /* Write metadata, and then pass to the receive level */ 529 /* Write metadata, and then pass to the receive level */
522 skb->dev = net; 530 skb->dev = net;
@@ -653,6 +661,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net,
653 return 0; 661 return 0;
654 662
655 no_peer: 663 no_peer:
664 err:
656 net->stats.rx_errors++; 665 net->stats.rx_errors++;
657 net->stats.rx_dropped++; 666 net->stats.rx_dropped++;
658 667
@@ -1340,9 +1349,17 @@ static netdev_tx_t fwnet_tx(struct sk_buff *skb, struct net_device *net)
1340 * We might need to rebuild the header on tx failure. 1349 * We might need to rebuild the header on tx failure.
1341 */ 1350 */
1342 memcpy(&hdr_buf, skb->data, sizeof(hdr_buf)); 1351 memcpy(&hdr_buf, skb->data, sizeof(hdr_buf));
1343 skb_pull(skb, sizeof(hdr_buf));
1344
1345 proto = hdr_buf.h_proto; 1352 proto = hdr_buf.h_proto;
1353
1354 switch (proto) {
1355 case htons(ETH_P_ARP):
1356 case htons(ETH_P_IP):
1357 break;
1358 default:
1359 goto fail;
1360 }
1361
1362 skb_pull(skb, sizeof(hdr_buf));
1346 dg_size = skb->len; 1363 dg_size = skb->len;
1347 1364
1348 /* 1365 /*