aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAntonio Quartulli <ordex@autistici.org>2012-11-25 18:38:50 -0500
committerAntonio Quartulli <ordex@autistici.org>2012-11-30 04:50:22 -0500
commitaf5d4f7737963f2112f148f97c5820425f050650 (patch)
treef5d5d7b9fcb172df041b8fb34fad875f0c87b9d5 /net
parentbb728820fe7c42fdb838ab2745fb5fe6b18b5ffa (diff)
batman-adv: use ETH_P_BATMAN
The ETH_P_BATMAN ethertype is now defined kernel-wide. Use it instead of the private BATADV_ETH_P_BATMAN define. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net')
-rw-r--r--net/batman-adv/hard-interface.c3
-rw-r--r--net/batman-adv/packet.h2
-rw-r--r--net/batman-adv/send.c6
-rw-r--r--net/batman-adv/soft-interface.c9
4 files changed, 11 insertions, 9 deletions
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index 365ed74f3946..f1d37cd81815 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -30,6 +30,7 @@
30#include "bridge_loop_avoidance.h" 30#include "bridge_loop_avoidance.h"
31 31
32#include <linux/if_arp.h> 32#include <linux/if_arp.h>
33#include <linux/if_ether.h>
33 34
34void batadv_hardif_free_rcu(struct rcu_head *rcu) 35void batadv_hardif_free_rcu(struct rcu_head *rcu)
35{ 36{
@@ -311,7 +312,7 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,
311{ 312{
312 struct batadv_priv *bat_priv; 313 struct batadv_priv *bat_priv;
313 struct net_device *soft_iface; 314 struct net_device *soft_iface;
314 __be16 ethertype = __constant_htons(BATADV_ETH_P_BATMAN); 315 __be16 ethertype = __constant_htons(ETH_P_BATMAN);
315 int ret; 316 int ret;
316 317
317 if (hard_iface->if_status != BATADV_IF_NOT_IN_USE) 318 if (hard_iface->if_status != BATADV_IF_NOT_IN_USE)
diff --git a/net/batman-adv/packet.h b/net/batman-adv/packet.h
index 1c5454d33f67..cb6405bf755c 100644
--- a/net/batman-adv/packet.h
+++ b/net/batman-adv/packet.h
@@ -20,8 +20,6 @@
20#ifndef _NET_BATMAN_ADV_PACKET_H_ 20#ifndef _NET_BATMAN_ADV_PACKET_H_
21#define _NET_BATMAN_ADV_PACKET_H_ 21#define _NET_BATMAN_ADV_PACKET_H_
22 22
23#define BATADV_ETH_P_BATMAN 0x4305 /* unofficial/not registered Ethertype */
24
25enum batadv_packettype { 23enum batadv_packettype {
26 BATADV_IV_OGM = 0x01, 24 BATADV_IV_OGM = 0x01,
27 BATADV_ICMP = 0x02, 25 BATADV_ICMP = 0x02,
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
index c7f702376535..4425af9dad40 100644
--- a/net/batman-adv/send.c
+++ b/net/batman-adv/send.c
@@ -28,6 +28,8 @@
28#include "gateway_common.h" 28#include "gateway_common.h"
29#include "originator.h" 29#include "originator.h"
30 30
31#include <linux/if_ether.h>
32
31static void batadv_send_outstanding_bcast_packet(struct work_struct *work); 33static void batadv_send_outstanding_bcast_packet(struct work_struct *work);
32 34
33/* send out an already prepared packet to the given address via the 35/* send out an already prepared packet to the given address via the
@@ -60,11 +62,11 @@ int batadv_send_skb_packet(struct sk_buff *skb,
60 ethhdr = (struct ethhdr *)skb_mac_header(skb); 62 ethhdr = (struct ethhdr *)skb_mac_header(skb);
61 memcpy(ethhdr->h_source, hard_iface->net_dev->dev_addr, ETH_ALEN); 63 memcpy(ethhdr->h_source, hard_iface->net_dev->dev_addr, ETH_ALEN);
62 memcpy(ethhdr->h_dest, dst_addr, ETH_ALEN); 64 memcpy(ethhdr->h_dest, dst_addr, ETH_ALEN);
63 ethhdr->h_proto = __constant_htons(BATADV_ETH_P_BATMAN); 65 ethhdr->h_proto = __constant_htons(ETH_P_BATMAN);
64 66
65 skb_set_network_header(skb, ETH_HLEN); 67 skb_set_network_header(skb, ETH_HLEN);
66 skb->priority = TC_PRIO_CONTROL; 68 skb->priority = TC_PRIO_CONTROL;
67 skb->protocol = __constant_htons(BATADV_ETH_P_BATMAN); 69 skb->protocol = __constant_htons(ETH_P_BATMAN);
68 70
69 skb->dev = hard_iface->net_dev; 71 skb->dev = hard_iface->net_dev;
70 72
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 54800c783f96..6b548fde8e04 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -34,6 +34,7 @@
34#include <linux/ethtool.h> 34#include <linux/ethtool.h>
35#include <linux/etherdevice.h> 35#include <linux/etherdevice.h>
36#include <linux/if_vlan.h> 36#include <linux/if_vlan.h>
37#include <linux/if_ether.h>
37#include "unicast.h" 38#include "unicast.h"
38#include "bridge_loop_avoidance.h" 39#include "bridge_loop_avoidance.h"
39 40
@@ -146,7 +147,7 @@ static int batadv_interface_tx(struct sk_buff *skb,
146 struct batadv_hard_iface *primary_if = NULL; 147 struct batadv_hard_iface *primary_if = NULL;
147 struct batadv_bcast_packet *bcast_packet; 148 struct batadv_bcast_packet *bcast_packet;
148 struct vlan_ethhdr *vhdr; 149 struct vlan_ethhdr *vhdr;
149 __be16 ethertype = __constant_htons(BATADV_ETH_P_BATMAN); 150 __be16 ethertype = __constant_htons(ETH_P_BATMAN);
150 static const uint8_t stp_addr[ETH_ALEN] = {0x01, 0x80, 0xC2, 0x00, 151 static const uint8_t stp_addr[ETH_ALEN] = {0x01, 0x80, 0xC2, 0x00,
151 0x00, 0x00}; 152 0x00, 0x00};
152 static const uint8_t ectp_addr[ETH_ALEN] = {0xCF, 0x00, 0x00, 0x00, 153 static const uint8_t ectp_addr[ETH_ALEN] = {0xCF, 0x00, 0x00, 0x00,
@@ -172,7 +173,7 @@ static int batadv_interface_tx(struct sk_buff *skb,
172 break; 173 break;
173 174
174 /* fall through */ 175 /* fall through */
175 case BATADV_ETH_P_BATMAN: 176 case ETH_P_BATMAN:
176 goto dropped; 177 goto dropped;
177 } 178 }
178 179
@@ -302,7 +303,7 @@ void batadv_interface_rx(struct net_device *soft_iface,
302 struct vlan_ethhdr *vhdr; 303 struct vlan_ethhdr *vhdr;
303 struct batadv_header *batadv_header = (struct batadv_header *)skb->data; 304 struct batadv_header *batadv_header = (struct batadv_header *)skb->data;
304 short vid __maybe_unused = -1; 305 short vid __maybe_unused = -1;
305 __be16 ethertype = __constant_htons(BATADV_ETH_P_BATMAN); 306 __be16 ethertype = __constant_htons(ETH_P_BATMAN);
306 bool is_bcast; 307 bool is_bcast;
307 308
308 is_bcast = (batadv_header->packet_type == BATADV_BCAST); 309 is_bcast = (batadv_header->packet_type == BATADV_BCAST);
@@ -325,7 +326,7 @@ void batadv_interface_rx(struct net_device *soft_iface,
325 break; 326 break;
326 327
327 /* fall through */ 328 /* fall through */
328 case BATADV_ETH_P_BATMAN: 329 case ETH_P_BATMAN:
329 goto dropped; 330 goto dropped;
330 } 331 }
331 332