Commit 9d1601ef authored by Marek Lindner's avatar Marek Lindner Committed by Antonio Quartulli

batman-adv: replace ethertype variable with ETH_P_BATMAN for readability

Signed-off-by: default avatarMarek Lindner <mareklindner@neomailbox.ch>
Reviewed-by: default avatarSven Eckelmann <sven@narfation.org>
Signed-off-by: default avatarAntonio Quartulli <a@unstable.cc>
parent 4b426b10
...@@ -186,7 +186,6 @@ static int batadv_interface_tx(struct sk_buff *skb, ...@@ -186,7 +186,6 @@ static int batadv_interface_tx(struct sk_buff *skb,
struct batadv_priv *bat_priv = netdev_priv(soft_iface); struct batadv_priv *bat_priv = netdev_priv(soft_iface);
struct batadv_hard_iface *primary_if = NULL; struct batadv_hard_iface *primary_if = NULL;
struct batadv_bcast_packet *bcast_packet; struct batadv_bcast_packet *bcast_packet;
__be16 ethertype = htons(ETH_P_BATMAN);
static const u8 stp_addr[ETH_ALEN] = {0x01, 0x80, 0xC2, 0x00, static const u8 stp_addr[ETH_ALEN] = {0x01, 0x80, 0xC2, 0x00,
0x00, 0x00}; 0x00, 0x00};
static const u8 ectp_addr[ETH_ALEN] = {0xCF, 0x00, 0x00, 0x00, static const u8 ectp_addr[ETH_ALEN] = {0xCF, 0x00, 0x00, 0x00,
...@@ -216,7 +215,8 @@ static int batadv_interface_tx(struct sk_buff *skb, ...@@ -216,7 +215,8 @@ static int batadv_interface_tx(struct sk_buff *skb,
case ETH_P_8021Q: case ETH_P_8021Q:
vhdr = vlan_eth_hdr(skb); vhdr = vlan_eth_hdr(skb);
if (vhdr->h_vlan_encapsulated_proto != ethertype) { /* drop batman-in-batman packets to prevent loops */
if (vhdr->h_vlan_encapsulated_proto != htons(ETH_P_BATMAN)) {
network_offset += VLAN_HLEN; network_offset += VLAN_HLEN;
break; break;
} }
...@@ -404,7 +404,6 @@ void batadv_interface_rx(struct net_device *soft_iface, ...@@ -404,7 +404,6 @@ void batadv_interface_rx(struct net_device *soft_iface,
{ {
struct batadv_bcast_packet *batadv_bcast_packet; struct batadv_bcast_packet *batadv_bcast_packet;
struct batadv_priv *bat_priv = netdev_priv(soft_iface); struct batadv_priv *bat_priv = netdev_priv(soft_iface);
__be16 ethertype = htons(ETH_P_BATMAN);
struct vlan_ethhdr *vhdr; struct vlan_ethhdr *vhdr;
struct ethhdr *ethhdr; struct ethhdr *ethhdr;
unsigned short vid; unsigned short vid;
...@@ -434,7 +433,8 @@ void batadv_interface_rx(struct net_device *soft_iface, ...@@ -434,7 +433,8 @@ void batadv_interface_rx(struct net_device *soft_iface,
vhdr = (struct vlan_ethhdr *)skb->data; vhdr = (struct vlan_ethhdr *)skb->data;
if (vhdr->h_vlan_encapsulated_proto != ethertype) /* drop batman-in-batman packets to prevent loops */
if (vhdr->h_vlan_encapsulated_proto != htons(ETH_P_BATMAN))
break; break;
/* fall through */ /* fall through */
......
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