Commit 18406d7e authored by YOSHIFUJI Hideaki / 吉藤英明's avatar YOSHIFUJI Hideaki / 吉藤英明 Committed by David S. Miller

firewire net: Accept IPv4 and ARP only.

Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b8092861
...@@ -517,6 +517,14 @@ static int fwnet_finish_incoming_packet(struct net_device *net, ...@@ -517,6 +517,14 @@ static int fwnet_finish_incoming_packet(struct net_device *net,
int status; int status;
__be64 guid; __be64 guid;
switch (ether_type) {
case ETH_P_ARP:
case ETH_P_IP:
break;
default:
goto err;
}
dev = netdev_priv(net); dev = netdev_priv(net);
/* Write metadata, and then pass to the receive level */ /* Write metadata, and then pass to the receive level */
skb->dev = net; skb->dev = net;
...@@ -653,6 +661,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net, ...@@ -653,6 +661,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net,
return 0; return 0;
no_peer: no_peer:
err:
net->stats.rx_errors++; net->stats.rx_errors++;
net->stats.rx_dropped++; net->stats.rx_dropped++;
...@@ -1340,9 +1349,17 @@ static netdev_tx_t fwnet_tx(struct sk_buff *skb, struct net_device *net) ...@@ -1340,9 +1349,17 @@ static netdev_tx_t fwnet_tx(struct sk_buff *skb, struct net_device *net)
* We might need to rebuild the header on tx failure. * We might need to rebuild the header on tx failure.
*/ */
memcpy(&hdr_buf, skb->data, sizeof(hdr_buf)); memcpy(&hdr_buf, skb->data, sizeof(hdr_buf));
skb_pull(skb, sizeof(hdr_buf));
proto = hdr_buf.h_proto; proto = hdr_buf.h_proto;
switch (proto) {
case htons(ETH_P_ARP):
case htons(ETH_P_IP):
break;
default:
goto fail;
}
skb_pull(skb, sizeof(hdr_buf));
dg_size = skb->len; dg_size = skb->len;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment