Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d3f4a687 authored by Kris Katterjohn's avatar Kris Katterjohn Committed by David S. Miller
Browse files

[NET]: Change memcmp(,,ETH_ALEN) to compare_ether_addr()



This changes some memcmp(one,two,ETH_ALEN) to compare_ether_addr(one,two).

Signed-off-by: default avatarKris Katterjohn <kjak@users.sourceforge.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 770cfbcf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -214,7 +214,7 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
		 * This allows the VLAN to have a different MAC than the underlying
		 * device, and still route correctly.
		 */
		if (memcmp(eth_hdr(skb)->h_dest, skb->dev->dev_addr, ETH_ALEN) == 0) {
		if (!compare_ether_addr(eth_hdr(skb)->h_dest, skb->dev->dev_addr)) {
			/* It is for our (changed) MAC-address! */
			skb->pkt_type = PACKET_HOST;
		}
+2 −2
Original line number Diff line number Diff line
@@ -296,13 +296,13 @@ static inline __be16 br_type_trans(struct sk_buff *skb, struct net_device *dev)
	eth = eth_hdr(skb);

	if (is_multicast_ether_addr(eth->h_dest)) {
		if (memcmp(eth->h_dest, dev->broadcast, ETH_ALEN) == 0)
		if (!compare_ether_addr(eth->h_dest, dev->broadcast))
			skb->pkt_type = PACKET_BROADCAST;
		else
			skb->pkt_type = PACKET_MULTICAST;
	}

	else if (memcmp(eth->h_dest, dev->dev_addr, ETH_ALEN))
	else if (compare_ether_addr(eth->h_dest, dev->dev_addr))
		skb->pkt_type = PACKET_OTHERHOST;

	if (ntohs(eth->h_proto) >= 1536)
+3 −3
Original line number Diff line number Diff line
@@ -1321,7 +1321,7 @@ static int lane2_associate_req (struct net_device *dev, u8 *lan_dst,
        struct sk_buff *skb;
        struct lec_priv *priv = (struct lec_priv*)dev->priv;

        if ( memcmp(lan_dst, dev->dev_addr, ETH_ALEN) != 0 )
        if (compare_ether_addr(lan_dst, dev->dev_addr))
                return (0);       /* not our mac address */

        kfree(priv->tlvs); /* NULL if there was no previous association */
@@ -1798,7 +1798,7 @@ lec_arp_find(struct lec_priv *priv,
  
        to_return = priv->lec_arp_tables[place];
        while(to_return) {
                if (memcmp(mac_addr, to_return->mac_addr, ETH_ALEN) == 0) {
                if (!compare_ether_addr(mac_addr, to_return->mac_addr)) {
                        return to_return;
                }
                to_return = to_return->next;
@@ -2002,7 +2002,7 @@ lec_arp_resolve(struct lec_priv *priv, unsigned char *mac_to_find,
                        return priv->mcast_vcc;
                        break;
                case 2:  /* LANE2 wants arp for multicast addresses */
                        if ( memcmp(mac_to_find, bus_mac, ETH_ALEN) == 0)
                        if (!compare_ether_addr(mac_to_find, bus_mac))
                                return priv->mcast_vcc;
                        break;
                default:
+1 −1
Original line number Diff line number Diff line
@@ -552,7 +552,7 @@ static int mpc_send_packet(struct sk_buff *skb, struct net_device *dev)
		goto non_ip; /* Multi-Protocol Over ATM :-) */

	while (i < mpc->number_of_mps_macs) {
		if (memcmp(eth->h_dest, (mpc->mps_macs + i*ETH_ALEN), ETH_ALEN) == 0)
		if (!compare_ether_addr(eth->h_dest, (mpc->mps_macs + i*ETH_ALEN)))
			if ( send_via_shortcut(skb, mpc) == 0 )           /* try shortcut */
				return 0;                                 /* success!     */
		i++;
+3 −3
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ static struct bnep_session *__bnep_get_session(u8 *dst)

	list_for_each(p, &bnep_session_list) {
		s = list_entry(p, struct bnep_session, list);	
		if (!memcmp(dst, s->eh.h_source, ETH_ALEN))
		if (!compare_ether_addr(dst, s->eh.h_source))
			return s;
	}
	return NULL;
@@ -420,10 +420,10 @@ static inline int bnep_tx_frame(struct bnep_session *s, struct sk_buff *skb)
	iv[il++] = (struct kvec) { &type, 1 };
	len++;

	if (!memcmp(eh->h_dest, s->eh.h_source, ETH_ALEN))
	if (!compare_ether_addr(eh->h_dest, s->eh.h_source))
		type |= 0x01;

	if (!memcmp(eh->h_source, s->eh.h_dest, ETH_ALEN))
	if (!compare_ether_addr(eh->h_source, s->eh.h_dest))
		type |= 0x02;

	if (type)
Loading