aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/net.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org>2013-03-25 04:25:48 -0400
committerDavid S. Miller <davem@davemloft.net>2013-03-26 12:32:13 -0400
commit021b97e469714b31b9e808c91b49543a8766c342 (patch)
tree890f1b391286de8ebba81273c0d8232122b97008 /drivers/firewire/net.c
parent18406d7e42a67d7b3a3b3ed17be6626a51d8c715 (diff)
firewire net: Send L2 multicast via GASP.
Send L2 multicast packet via GASP (Global asynchronous stream packet) by seeing the multicast bit in the L2 hardware address, not by seeing upper- layer protocol address. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/firewire/net.c')
-rw-r--r--drivers/firewire/net.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
index d438c5be8c21..7c2e16a1db4f 100644
--- a/drivers/firewire/net.c
+++ b/drivers/firewire/net.c
@@ -84,6 +84,11 @@ struct fwnet_header {
84 __be16 h_proto; /* packet type ID field */ 84 __be16 h_proto; /* packet type ID field */
85} __packed; 85} __packed;
86 86
87static bool fwnet_hwaddr_is_multicast(u8 *ha)
88{
89 return !!(*ha & 1);
90}
91
87/* IPv4 and IPv6 encapsulation header */ 92/* IPv4 and IPv6 encapsulation header */
88struct rfc2734_header { 93struct rfc2734_header {
89 u32 w0; 94 u32 w0;
@@ -626,7 +631,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net,
626 skb_reset_mac_header(skb); 631 skb_reset_mac_header(skb);
627 skb_pull(skb, sizeof(*eth)); 632 skb_pull(skb, sizeof(*eth));
628 eth = (struct fwnet_header *)skb_mac_header(skb); 633 eth = (struct fwnet_header *)skb_mac_header(skb);
629 if (*eth->h_dest & 1) { 634 if (fwnet_hwaddr_is_multicast(eth->h_dest)) {
630 if (memcmp(eth->h_dest, net->broadcast, 635 if (memcmp(eth->h_dest, net->broadcast,
631 net->addr_len) == 0) 636 net->addr_len) == 0)
632 skb->pkt_type = PACKET_BROADCAST; 637 skb->pkt_type = PACKET_BROADCAST;
@@ -1366,10 +1371,7 @@ static netdev_tx_t fwnet_tx(struct sk_buff *skb, struct net_device *net)
1366 * Set the transmission type for the packet. ARP packets and IP 1371 * Set the transmission type for the packet. ARP packets and IP
1367 * broadcast packets are sent via GASP. 1372 * broadcast packets are sent via GASP.
1368 */ 1373 */
1369 if (memcmp(hdr_buf.h_dest, net->broadcast, FWNET_ALEN) == 0 1374 if (fwnet_hwaddr_is_multicast(hdr_buf.h_dest)) {
1370 || proto == htons(ETH_P_ARP)
1371 || (proto == htons(ETH_P_IP)
1372 && IN_MULTICAST(ntohl(ip_hdr(skb)->daddr)))) {
1373 max_payload = dev->broadcast_xmt_max_payload; 1375 max_payload = dev->broadcast_xmt_max_payload;
1374 datagram_label_ptr = &dev->broadcast_xmt_datagramlabel; 1376 datagram_label_ptr = &dev->broadcast_xmt_datagramlabel;
1375 1377