diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2011-07-29 11:31:50 -0400 |
---|---|---|
committer | Marek Lindner <lindner_marek@yahoo.de> | 2011-09-08 11:37:51 -0400 |
commit | b6da4bf5d7951aba4f86d65546474c4e718f650f (patch) | |
tree | 960ba68ea86c341ec938178f9c27a09cf151861c /net/batman-adv | |
parent | a943cac144e035c21d4f1b31b95f15b33c33a480 (diff) |
batman-adv: rename all instances of batman_packet to batman_ogm_packet
The follow-up routing code changes are going to introduce additional
routing packet types which make this distinction necessary.
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv')
-rw-r--r-- | net/batman-adv/aggregation.c | 48 | ||||
-rw-r--r-- | net/batman-adv/aggregation.h | 2 | ||||
-rw-r--r-- | net/batman-adv/hard-interface.c | 49 | ||||
-rw-r--r-- | net/batman-adv/packet.h | 18 | ||||
-rw-r--r-- | net/batman-adv/routing.c | 118 | ||||
-rw-r--r-- | net/batman-adv/routing.h | 2 | ||||
-rw-r--r-- | net/batman-adv/send.c | 130 | ||||
-rw-r--r-- | net/batman-adv/send.h | 2 | ||||
-rw-r--r-- | net/batman-adv/soft-interface.c | 17 |
9 files changed, 204 insertions, 182 deletions
diff --git a/net/batman-adv/aggregation.c b/net/batman-adv/aggregation.c index 69467fe71ff2..f20423f4a4d7 100644 --- a/net/batman-adv/aggregation.c +++ b/net/batman-adv/aggregation.c | |||
@@ -27,7 +27,8 @@ | |||
27 | #include "hard-interface.h" | 27 | #include "hard-interface.h" |
28 | 28 | ||
29 | /* return true if new_packet can be aggregated with forw_packet */ | 29 | /* return true if new_packet can be aggregated with forw_packet */ |
30 | static bool can_aggregate_with(const struct batman_packet *new_batman_packet, | 30 | static bool can_aggregate_with(const struct batman_ogm_packet |
31 | *new_batman_ogm_packet, | ||
31 | struct bat_priv *bat_priv, | 32 | struct bat_priv *bat_priv, |
32 | int packet_len, | 33 | int packet_len, |
33 | unsigned long send_time, | 34 | unsigned long send_time, |
@@ -35,8 +36,8 @@ static bool can_aggregate_with(const struct batman_packet *new_batman_packet, | |||
35 | const struct hard_iface *if_incoming, | 36 | const struct hard_iface *if_incoming, |
36 | const struct forw_packet *forw_packet) | 37 | const struct forw_packet *forw_packet) |
37 | { | 38 | { |
38 | struct batman_packet *batman_packet = | 39 | struct batman_ogm_packet *batman_ogm_packet = |
39 | (struct batman_packet *)forw_packet->skb->data; | 40 | (struct batman_ogm_packet *)forw_packet->skb->data; |
40 | int aggregated_bytes = forw_packet->packet_len + packet_len; | 41 | int aggregated_bytes = forw_packet->packet_len + packet_len; |
41 | struct hard_iface *primary_if = NULL; | 42 | struct hard_iface *primary_if = NULL; |
42 | bool res = false; | 43 | bool res = false; |
@@ -71,8 +72,8 @@ static bool can_aggregate_with(const struct batman_packet *new_batman_packet, | |||
71 | /* packets without direct link flag and high TTL | 72 | /* packets without direct link flag and high TTL |
72 | * are flooded through the net */ | 73 | * are flooded through the net */ |
73 | if ((!directlink) && | 74 | if ((!directlink) && |
74 | (!(batman_packet->flags & DIRECTLINK)) && | 75 | (!(batman_ogm_packet->flags & DIRECTLINK)) && |
75 | (batman_packet->ttl != 1) && | 76 | (batman_ogm_packet->ttl != 1) && |
76 | 77 | ||
77 | /* own packets originating non-primary | 78 | /* own packets originating non-primary |
78 | * interfaces leave only that interface */ | 79 | * interfaces leave only that interface */ |
@@ -85,13 +86,13 @@ static bool can_aggregate_with(const struct batman_packet *new_batman_packet, | |||
85 | /* if the incoming packet is sent via this one | 86 | /* if the incoming packet is sent via this one |
86 | * interface only - we still can aggregate */ | 87 | * interface only - we still can aggregate */ |
87 | if ((directlink) && | 88 | if ((directlink) && |
88 | (new_batman_packet->ttl == 1) && | 89 | (new_batman_ogm_packet->ttl == 1) && |
89 | (forw_packet->if_incoming == if_incoming) && | 90 | (forw_packet->if_incoming == if_incoming) && |
90 | 91 | ||
91 | /* packets from direct neighbors or | 92 | /* packets from direct neighbors or |
92 | * own secondary interface packets | 93 | * own secondary interface packets |
93 | * (= secondary interface packets in general) */ | 94 | * (= secondary interface packets in general) */ |
94 | (batman_packet->flags & DIRECTLINK || | 95 | (batman_ogm_packet->flags & DIRECTLINK || |
95 | (forw_packet->own && | 96 | (forw_packet->own && |
96 | forw_packet->if_incoming != primary_if))) { | 97 | forw_packet->if_incoming != primary_if))) { |
97 | res = true; | 98 | res = true; |
@@ -213,9 +214,11 @@ void add_bat_packet_to_list(struct bat_priv *bat_priv, | |||
213 | */ | 214 | */ |
214 | struct forw_packet *forw_packet_aggr = NULL, *forw_packet_pos = NULL; | 215 | struct forw_packet *forw_packet_aggr = NULL, *forw_packet_pos = NULL; |
215 | struct hlist_node *tmp_node; | 216 | struct hlist_node *tmp_node; |
216 | struct batman_packet *batman_packet = | 217 | struct batman_ogm_packet *batman_ogm_packet; |
217 | (struct batman_packet *)packet_buff; | 218 | bool direct_link; |
218 | bool direct_link = batman_packet->flags & DIRECTLINK ? 1 : 0; | 219 | |
220 | batman_ogm_packet = (struct batman_ogm_packet *)packet_buff; | ||
221 | direct_link = batman_ogm_packet->flags & DIRECTLINK ? 1 : 0; | ||
219 | 222 | ||
220 | /* find position for the packet in the forward queue */ | 223 | /* find position for the packet in the forward queue */ |
221 | spin_lock_bh(&bat_priv->forw_bat_list_lock); | 224 | spin_lock_bh(&bat_priv->forw_bat_list_lock); |
@@ -223,7 +226,7 @@ void add_bat_packet_to_list(struct bat_priv *bat_priv, | |||
223 | if ((atomic_read(&bat_priv->aggregated_ogms)) && (!own_packet)) { | 226 | if ((atomic_read(&bat_priv->aggregated_ogms)) && (!own_packet)) { |
224 | hlist_for_each_entry(forw_packet_pos, tmp_node, | 227 | hlist_for_each_entry(forw_packet_pos, tmp_node, |
225 | &bat_priv->forw_bat_list, list) { | 228 | &bat_priv->forw_bat_list, list) { |
226 | if (can_aggregate_with(batman_packet, | 229 | if (can_aggregate_with(batman_ogm_packet, |
227 | bat_priv, | 230 | bat_priv, |
228 | packet_len, | 231 | packet_len, |
229 | send_time, | 232 | send_time, |
@@ -267,27 +270,28 @@ void receive_aggr_bat_packet(const struct ethhdr *ethhdr, | |||
267 | unsigned char *packet_buff, int packet_len, | 270 | unsigned char *packet_buff, int packet_len, |
268 | struct hard_iface *if_incoming) | 271 | struct hard_iface *if_incoming) |
269 | { | 272 | { |
270 | struct batman_packet *batman_packet; | 273 | struct batman_ogm_packet *batman_ogm_packet; |
271 | int buff_pos = 0; | 274 | int buff_pos = 0; |
272 | unsigned char *tt_buff; | 275 | unsigned char *tt_buff; |
273 | 276 | ||
274 | batman_packet = (struct batman_packet *)packet_buff; | 277 | batman_ogm_packet = (struct batman_ogm_packet *)packet_buff; |
275 | 278 | ||
276 | do { | 279 | do { |
277 | /* network to host order for our 32bit seqno and the | 280 | /* network to host order for our 32bit seqno and the |
278 | orig_interval */ | 281 | orig_interval */ |
279 | batman_packet->seqno = ntohl(batman_packet->seqno); | 282 | batman_ogm_packet->seqno = ntohl(batman_ogm_packet->seqno); |
280 | batman_packet->tt_crc = ntohs(batman_packet->tt_crc); | 283 | batman_ogm_packet->tt_crc = ntohs(batman_ogm_packet->tt_crc); |
281 | 284 | ||
282 | tt_buff = packet_buff + buff_pos + BAT_PACKET_LEN; | 285 | tt_buff = packet_buff + buff_pos + BATMAN_OGM_LEN; |
283 | 286 | ||
284 | receive_bat_packet(ethhdr, batman_packet, tt_buff, if_incoming); | 287 | receive_bat_packet(ethhdr, batman_ogm_packet, |
288 | tt_buff, if_incoming); | ||
285 | 289 | ||
286 | buff_pos += BAT_PACKET_LEN + | 290 | buff_pos += BATMAN_OGM_LEN + |
287 | tt_len(batman_packet->tt_num_changes); | 291 | tt_len(batman_ogm_packet->tt_num_changes); |
288 | 292 | ||
289 | batman_packet = (struct batman_packet *) | 293 | batman_ogm_packet = (struct batman_ogm_packet *) |
290 | (packet_buff + buff_pos); | 294 | (packet_buff + buff_pos); |
291 | } while (aggregated_packet(buff_pos, packet_len, | 295 | } while (aggregated_packet(buff_pos, packet_len, |
292 | batman_packet->tt_num_changes)); | 296 | batman_ogm_packet->tt_num_changes)); |
293 | } | 297 | } |
diff --git a/net/batman-adv/aggregation.h b/net/batman-adv/aggregation.h index df4a5a943088..7fc23b028b2a 100644 --- a/net/batman-adv/aggregation.h +++ b/net/batman-adv/aggregation.h | |||
@@ -28,7 +28,7 @@ | |||
28 | static inline int aggregated_packet(int buff_pos, int packet_len, | 28 | static inline int aggregated_packet(int buff_pos, int packet_len, |
29 | int tt_num_changes) | 29 | int tt_num_changes) |
30 | { | 30 | { |
31 | int next_buff_pos = buff_pos + BAT_PACKET_LEN + tt_len(tt_num_changes); | 31 | int next_buff_pos = buff_pos + BATMAN_OGM_LEN + tt_len(tt_num_changes); |
32 | 32 | ||
33 | return (next_buff_pos <= packet_len) && | 33 | return (next_buff_pos <= packet_len) && |
34 | (next_buff_pos <= MAX_AGGREGATION_BYTES); | 34 | (next_buff_pos <= MAX_AGGREGATION_BYTES); |
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index bf91e4d8a47f..cf9f4afafdfa 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c | |||
@@ -131,7 +131,7 @@ static void primary_if_select(struct bat_priv *bat_priv, | |||
131 | struct hard_iface *new_hard_iface) | 131 | struct hard_iface *new_hard_iface) |
132 | { | 132 | { |
133 | struct hard_iface *curr_hard_iface; | 133 | struct hard_iface *curr_hard_iface; |
134 | struct batman_packet *batman_packet; | 134 | struct batman_ogm_packet *batman_ogm_packet; |
135 | 135 | ||
136 | ASSERT_RTNL(); | 136 | ASSERT_RTNL(); |
137 | 137 | ||
@@ -147,9 +147,10 @@ static void primary_if_select(struct bat_priv *bat_priv, | |||
147 | if (!new_hard_iface) | 147 | if (!new_hard_iface) |
148 | return; | 148 | return; |
149 | 149 | ||
150 | batman_packet = (struct batman_packet *)(new_hard_iface->packet_buff); | 150 | batman_ogm_packet = (struct batman_ogm_packet *) |
151 | batman_packet->flags = PRIMARIES_FIRST_HOP; | 151 | (new_hard_iface->packet_buff); |
152 | batman_packet->ttl = TTL; | 152 | batman_ogm_packet->flags = PRIMARIES_FIRST_HOP; |
153 | batman_ogm_packet->ttl = TTL; | ||
153 | 154 | ||
154 | primary_if_update_addr(bat_priv); | 155 | primary_if_update_addr(bat_priv); |
155 | } | 156 | } |
@@ -164,9 +165,12 @@ static bool hardif_is_iface_up(const struct hard_iface *hard_iface) | |||
164 | 165 | ||
165 | static void update_mac_addresses(struct hard_iface *hard_iface) | 166 | static void update_mac_addresses(struct hard_iface *hard_iface) |
166 | { | 167 | { |
167 | memcpy(((struct batman_packet *)(hard_iface->packet_buff))->orig, | 168 | struct batman_ogm_packet *batman_ogm_packet; |
169 | |||
170 | batman_ogm_packet = (struct batman_ogm_packet *)hard_iface->packet_buff; | ||
171 | memcpy(batman_ogm_packet->orig, | ||
168 | hard_iface->net_dev->dev_addr, ETH_ALEN); | 172 | hard_iface->net_dev->dev_addr, ETH_ALEN); |
169 | memcpy(((struct batman_packet *)(hard_iface->packet_buff))->prev_sender, | 173 | memcpy(batman_ogm_packet->prev_sender, |
170 | hard_iface->net_dev->dev_addr, ETH_ALEN); | 174 | hard_iface->net_dev->dev_addr, ETH_ALEN); |
171 | } | 175 | } |
172 | 176 | ||
@@ -283,7 +287,7 @@ int hardif_enable_interface(struct hard_iface *hard_iface, | |||
283 | const char *iface_name) | 287 | const char *iface_name) |
284 | { | 288 | { |
285 | struct bat_priv *bat_priv; | 289 | struct bat_priv *bat_priv; |
286 | struct batman_packet *batman_packet; | 290 | struct batman_ogm_packet *batman_ogm_packet; |
287 | struct net_device *soft_iface; | 291 | struct net_device *soft_iface; |
288 | int ret; | 292 | int ret; |
289 | 293 | ||
@@ -318,7 +322,7 @@ int hardif_enable_interface(struct hard_iface *hard_iface, | |||
318 | 322 | ||
319 | hard_iface->soft_iface = soft_iface; | 323 | hard_iface->soft_iface = soft_iface; |
320 | bat_priv = netdev_priv(hard_iface->soft_iface); | 324 | bat_priv = netdev_priv(hard_iface->soft_iface); |
321 | hard_iface->packet_len = BAT_PACKET_LEN; | 325 | hard_iface->packet_len = BATMAN_OGM_LEN; |
322 | hard_iface->packet_buff = kmalloc(hard_iface->packet_len, GFP_ATOMIC); | 326 | hard_iface->packet_buff = kmalloc(hard_iface->packet_len, GFP_ATOMIC); |
323 | 327 | ||
324 | if (!hard_iface->packet_buff) { | 328 | if (!hard_iface->packet_buff) { |
@@ -328,14 +332,15 @@ int hardif_enable_interface(struct hard_iface *hard_iface, | |||
328 | goto err; | 332 | goto err; |
329 | } | 333 | } |
330 | 334 | ||
331 | batman_packet = (struct batman_packet *)(hard_iface->packet_buff); | 335 | batman_ogm_packet = (struct batman_ogm_packet *) |
332 | batman_packet->packet_type = BAT_PACKET; | 336 | (hard_iface->packet_buff); |
333 | batman_packet->version = COMPAT_VERSION; | 337 | batman_ogm_packet->packet_type = BAT_OGM; |
334 | batman_packet->flags = NO_FLAGS; | 338 | batman_ogm_packet->version = COMPAT_VERSION; |
335 | batman_packet->ttl = 2; | 339 | batman_ogm_packet->flags = NO_FLAGS; |
336 | batman_packet->tq = TQ_MAX_VALUE; | 340 | batman_ogm_packet->ttl = 2; |
337 | batman_packet->tt_num_changes = 0; | 341 | batman_ogm_packet->tq = TQ_MAX_VALUE; |
338 | batman_packet->ttvn = 0; | 342 | batman_ogm_packet->tt_num_changes = 0; |
343 | batman_ogm_packet->ttvn = 0; | ||
339 | 344 | ||
340 | hard_iface->if_num = bat_priv->num_ifaces; | 345 | hard_iface->if_num = bat_priv->num_ifaces; |
341 | bat_priv->num_ifaces++; | 346 | bat_priv->num_ifaces++; |
@@ -580,7 +585,7 @@ static int batman_skb_recv(struct sk_buff *skb, struct net_device *dev, | |||
580 | struct net_device *orig_dev) | 585 | struct net_device *orig_dev) |
581 | { | 586 | { |
582 | struct bat_priv *bat_priv; | 587 | struct bat_priv *bat_priv; |
583 | struct batman_packet *batman_packet; | 588 | struct batman_ogm_packet *batman_ogm_packet; |
584 | struct hard_iface *hard_iface; | 589 | struct hard_iface *hard_iface; |
585 | int ret; | 590 | int ret; |
586 | 591 | ||
@@ -612,21 +617,21 @@ static int batman_skb_recv(struct sk_buff *skb, struct net_device *dev, | |||
612 | if (hard_iface->if_status != IF_ACTIVE) | 617 | if (hard_iface->if_status != IF_ACTIVE) |
613 | goto err_free; | 618 | goto err_free; |
614 | 619 | ||
615 | batman_packet = (struct batman_packet *)skb->data; | 620 | batman_ogm_packet = (struct batman_ogm_packet *)skb->data; |
616 | 621 | ||
617 | if (batman_packet->version != COMPAT_VERSION) { | 622 | if (batman_ogm_packet->version != COMPAT_VERSION) { |
618 | bat_dbg(DBG_BATMAN, bat_priv, | 623 | bat_dbg(DBG_BATMAN, bat_priv, |
619 | "Drop packet: incompatible batman version (%i)\n", | 624 | "Drop packet: incompatible batman version (%i)\n", |
620 | batman_packet->version); | 625 | batman_ogm_packet->version); |
621 | goto err_free; | 626 | goto err_free; |
622 | } | 627 | } |
623 | 628 | ||
624 | /* all receive handlers return whether they received or reused | 629 | /* all receive handlers return whether they received or reused |
625 | * the supplied skb. if not, we have to free the skb. */ | 630 | * the supplied skb. if not, we have to free the skb. */ |
626 | 631 | ||
627 | switch (batman_packet->packet_type) { | 632 | switch (batman_ogm_packet->packet_type) { |
628 | /* batman originator packet */ | 633 | /* batman originator packet */ |
629 | case BAT_PACKET: | 634 | case BAT_OGM: |
630 | ret = recv_bat_packet(skb, hard_iface); | 635 | ret = recv_bat_packet(skb, hard_iface); |
631 | break; | 636 | break; |
632 | 637 | ||
diff --git a/net/batman-adv/packet.h b/net/batman-adv/packet.h index 8802eab2a46d..4d9e54c57a36 100644 --- a/net/batman-adv/packet.h +++ b/net/batman-adv/packet.h | |||
@@ -25,14 +25,14 @@ | |||
25 | #define ETH_P_BATMAN 0x4305 /* unofficial/not registered Ethertype */ | 25 | #define ETH_P_BATMAN 0x4305 /* unofficial/not registered Ethertype */ |
26 | 26 | ||
27 | enum bat_packettype { | 27 | enum bat_packettype { |
28 | BAT_PACKET = 0x01, | 28 | BAT_OGM = 0x01, |
29 | BAT_ICMP = 0x02, | 29 | BAT_ICMP = 0x02, |
30 | BAT_UNICAST = 0x03, | 30 | BAT_UNICAST = 0x03, |
31 | BAT_BCAST = 0x04, | 31 | BAT_BCAST = 0x04, |
32 | BAT_VIS = 0x05, | 32 | BAT_VIS = 0x05, |
33 | BAT_UNICAST_FRAG = 0x06, | 33 | BAT_UNICAST_FRAG = 0x06, |
34 | BAT_TT_QUERY = 0x07, | 34 | BAT_TT_QUERY = 0x07, |
35 | BAT_ROAM_ADV = 0x08 | 35 | BAT_ROAM_ADV = 0x08 |
36 | }; | 36 | }; |
37 | 37 | ||
38 | /* this file is included by batctl which needs these defines */ | 38 | /* this file is included by batctl which needs these defines */ |
@@ -90,7 +90,7 @@ enum tt_client_flags { | |||
90 | TT_CLIENT_PENDING = 1 << 10 | 90 | TT_CLIENT_PENDING = 1 << 10 |
91 | }; | 91 | }; |
92 | 92 | ||
93 | struct batman_packet { | 93 | struct batman_ogm_packet { |
94 | uint8_t packet_type; | 94 | uint8_t packet_type; |
95 | uint8_t version; /* batman version field */ | 95 | uint8_t version; /* batman version field */ |
96 | uint8_t ttl; | 96 | uint8_t ttl; |
@@ -105,7 +105,7 @@ struct batman_packet { | |||
105 | uint16_t tt_crc; | 105 | uint16_t tt_crc; |
106 | } __packed; | 106 | } __packed; |
107 | 107 | ||
108 | #define BAT_PACKET_LEN sizeof(struct batman_packet) | 108 | #define BATMAN_OGM_LEN sizeof(struct batman_ogm_packet) |
109 | 109 | ||
110 | struct icmp_packet { | 110 | struct icmp_packet { |
111 | uint8_t packet_type; | 111 | uint8_t packet_type; |
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 19499281b695..6efd1d0da54a 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -130,7 +130,7 @@ out: | |||
130 | 130 | ||
131 | static int is_bidirectional_neigh(struct orig_node *orig_node, | 131 | static int is_bidirectional_neigh(struct orig_node *orig_node, |
132 | struct orig_node *orig_neigh_node, | 132 | struct orig_node *orig_neigh_node, |
133 | struct batman_packet *batman_packet, | 133 | struct batman_ogm_packet *batman_ogm_packet, |
134 | struct hard_iface *if_incoming) | 134 | struct hard_iface *if_incoming) |
135 | { | 135 | { |
136 | struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); | 136 | struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); |
@@ -209,7 +209,8 @@ static int is_bidirectional_neigh(struct orig_node *orig_node, | |||
209 | TQ_LOCAL_WINDOW_SIZE * | 209 | TQ_LOCAL_WINDOW_SIZE * |
210 | TQ_LOCAL_WINDOW_SIZE); | 210 | TQ_LOCAL_WINDOW_SIZE); |
211 | 211 | ||
212 | batman_packet->tq = ((batman_packet->tq * tq_own * tq_asym_penalty) / | 212 | batman_ogm_packet->tq = ((batman_ogm_packet->tq * tq_own |
213 | * tq_asym_penalty) / | ||
213 | (TQ_MAX_VALUE * TQ_MAX_VALUE)); | 214 | (TQ_MAX_VALUE * TQ_MAX_VALUE)); |
214 | 215 | ||
215 | bat_dbg(DBG_BATMAN, bat_priv, | 216 | bat_dbg(DBG_BATMAN, bat_priv, |
@@ -218,11 +219,11 @@ static int is_bidirectional_neigh(struct orig_node *orig_node, | |||
218 | "real recv = %2i, local tq: %3i, asym_penalty: %3i, " | 219 | "real recv = %2i, local tq: %3i, asym_penalty: %3i, " |
219 | "total tq: %3i\n", | 220 | "total tq: %3i\n", |
220 | orig_node->orig, orig_neigh_node->orig, total_count, | 221 | orig_node->orig, orig_neigh_node->orig, total_count, |
221 | neigh_rq_count, tq_own, tq_asym_penalty, batman_packet->tq); | 222 | neigh_rq_count, tq_own, tq_asym_penalty, batman_ogm_packet->tq); |
222 | 223 | ||
223 | /* if link has the minimum required transmission quality | 224 | /* if link has the minimum required transmission quality |
224 | * consider it bidirectional */ | 225 | * consider it bidirectional */ |
225 | if (batman_packet->tq >= TQ_TOTAL_BIDRECT_LIMIT) | 226 | if (batman_ogm_packet->tq >= TQ_TOTAL_BIDRECT_LIMIT) |
226 | ret = 1; | 227 | ret = 1; |
227 | 228 | ||
228 | out: | 229 | out: |
@@ -321,9 +322,10 @@ out: | |||
321 | /* copy primary address for bonding */ | 322 | /* copy primary address for bonding */ |
322 | static void bonding_save_primary(const struct orig_node *orig_node, | 323 | static void bonding_save_primary(const struct orig_node *orig_node, |
323 | struct orig_node *orig_neigh_node, | 324 | struct orig_node *orig_neigh_node, |
324 | const struct batman_packet *batman_packet) | 325 | const struct batman_ogm_packet |
326 | *batman_ogm_packet) | ||
325 | { | 327 | { |
326 | if (!(batman_packet->flags & PRIMARIES_FIRST_HOP)) | 328 | if (!(batman_ogm_packet->flags & PRIMARIES_FIRST_HOP)) |
327 | return; | 329 | return; |
328 | 330 | ||
329 | memcpy(orig_neigh_node->primary_addr, orig_node->orig, ETH_ALEN); | 331 | memcpy(orig_neigh_node->primary_addr, orig_node->orig, ETH_ALEN); |
@@ -331,7 +333,7 @@ static void bonding_save_primary(const struct orig_node *orig_node, | |||
331 | 333 | ||
332 | static void update_orig(struct bat_priv *bat_priv, struct orig_node *orig_node, | 334 | static void update_orig(struct bat_priv *bat_priv, struct orig_node *orig_node, |
333 | const struct ethhdr *ethhdr, | 335 | const struct ethhdr *ethhdr, |
334 | const struct batman_packet *batman_packet, | 336 | const struct batman_ogm_packet *batman_ogm_packet, |
335 | struct hard_iface *if_incoming, | 337 | struct hard_iface *if_incoming, |
336 | const unsigned char *tt_buff, int is_duplicate) | 338 | const unsigned char *tt_buff, int is_duplicate) |
337 | { | 339 | { |
@@ -386,19 +388,19 @@ static void update_orig(struct bat_priv *bat_priv, struct orig_node *orig_node, | |||
386 | 388 | ||
387 | rcu_read_unlock(); | 389 | rcu_read_unlock(); |
388 | 390 | ||
389 | orig_node->flags = batman_packet->flags; | 391 | orig_node->flags = batman_ogm_packet->flags; |
390 | neigh_node->last_valid = jiffies; | 392 | neigh_node->last_valid = jiffies; |
391 | 393 | ||
392 | spin_lock_bh(&neigh_node->tq_lock); | 394 | spin_lock_bh(&neigh_node->tq_lock); |
393 | ring_buffer_set(neigh_node->tq_recv, | 395 | ring_buffer_set(neigh_node->tq_recv, |
394 | &neigh_node->tq_index, | 396 | &neigh_node->tq_index, |
395 | batman_packet->tq); | 397 | batman_ogm_packet->tq); |
396 | neigh_node->tq_avg = ring_buffer_avg(neigh_node->tq_recv); | 398 | neigh_node->tq_avg = ring_buffer_avg(neigh_node->tq_recv); |
397 | spin_unlock_bh(&neigh_node->tq_lock); | 399 | spin_unlock_bh(&neigh_node->tq_lock); |
398 | 400 | ||
399 | if (!is_duplicate) { | 401 | if (!is_duplicate) { |
400 | orig_node->last_ttl = batman_packet->ttl; | 402 | orig_node->last_ttl = batman_ogm_packet->ttl; |
401 | neigh_node->last_ttl = batman_packet->ttl; | 403 | neigh_node->last_ttl = batman_ogm_packet->ttl; |
402 | } | 404 | } |
403 | 405 | ||
404 | bonding_candidate_add(orig_node, neigh_node); | 406 | bonding_candidate_add(orig_node, neigh_node); |
@@ -437,17 +439,19 @@ static void update_orig(struct bat_priv *bat_priv, struct orig_node *orig_node, | |||
437 | update_tt: | 439 | update_tt: |
438 | /* I have to check for transtable changes only if the OGM has been | 440 | /* I have to check for transtable changes only if the OGM has been |
439 | * sent through a primary interface */ | 441 | * sent through a primary interface */ |
440 | if (((batman_packet->orig != ethhdr->h_source) && | 442 | if (((batman_ogm_packet->orig != ethhdr->h_source) && |
441 | (batman_packet->ttl > 2)) || | 443 | (batman_ogm_packet->ttl > 2)) || |
442 | (batman_packet->flags & PRIMARIES_FIRST_HOP)) | 444 | (batman_ogm_packet->flags & PRIMARIES_FIRST_HOP)) |
443 | tt_update_orig(bat_priv, orig_node, tt_buff, | 445 | tt_update_orig(bat_priv, orig_node, tt_buff, |
444 | batman_packet->tt_num_changes, | 446 | batman_ogm_packet->tt_num_changes, |
445 | batman_packet->ttvn, batman_packet->tt_crc); | 447 | batman_ogm_packet->ttvn, |
448 | batman_ogm_packet->tt_crc); | ||
446 | 449 | ||
447 | if (orig_node->gw_flags != batman_packet->gw_flags) | 450 | if (orig_node->gw_flags != batman_ogm_packet->gw_flags) |
448 | gw_node_update(bat_priv, orig_node, batman_packet->gw_flags); | 451 | gw_node_update(bat_priv, orig_node, |
452 | batman_ogm_packet->gw_flags); | ||
449 | 453 | ||
450 | orig_node->gw_flags = batman_packet->gw_flags; | 454 | orig_node->gw_flags = batman_ogm_packet->gw_flags; |
451 | 455 | ||
452 | /* restart gateway selection if fast or late switching was enabled */ | 456 | /* restart gateway selection if fast or late switching was enabled */ |
453 | if ((orig_node->gw_flags) && | 457 | if ((orig_node->gw_flags) && |
@@ -500,8 +504,8 @@ static int window_protected(struct bat_priv *bat_priv, | |||
500 | * was protected. Caller should drop it. | 504 | * was protected. Caller should drop it. |
501 | */ | 505 | */ |
502 | static int count_real_packets(const struct ethhdr *ethhdr, | 506 | static int count_real_packets(const struct ethhdr *ethhdr, |
503 | const struct batman_packet *batman_packet, | 507 | const struct batman_ogm_packet *batman_ogm_packet, |
504 | const struct hard_iface *if_incoming) | 508 | const struct hard_iface *if_incoming) |
505 | { | 509 | { |
506 | struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); | 510 | struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); |
507 | struct orig_node *orig_node; | 511 | struct orig_node *orig_node; |
@@ -512,12 +516,12 @@ static int count_real_packets(const struct ethhdr *ethhdr, | |||
512 | int need_update = 0; | 516 | int need_update = 0; |
513 | int set_mark, ret = -1; | 517 | int set_mark, ret = -1; |
514 | 518 | ||
515 | orig_node = get_orig_node(bat_priv, batman_packet->orig); | 519 | orig_node = get_orig_node(bat_priv, batman_ogm_packet->orig); |
516 | if (!orig_node) | 520 | if (!orig_node) |
517 | return 0; | 521 | return 0; |
518 | 522 | ||
519 | spin_lock_bh(&orig_node->ogm_cnt_lock); | 523 | spin_lock_bh(&orig_node->ogm_cnt_lock); |
520 | seq_diff = batman_packet->seqno - orig_node->last_real_seqno; | 524 | seq_diff = batman_ogm_packet->seqno - orig_node->last_real_seqno; |
521 | 525 | ||
522 | /* signalize caller that the packet is to be dropped. */ | 526 | /* signalize caller that the packet is to be dropped. */ |
523 | if (window_protected(bat_priv, seq_diff, | 527 | if (window_protected(bat_priv, seq_diff, |
@@ -530,7 +534,7 @@ static int count_real_packets(const struct ethhdr *ethhdr, | |||
530 | 534 | ||
531 | is_duplicate |= get_bit_status(tmp_neigh_node->real_bits, | 535 | is_duplicate |= get_bit_status(tmp_neigh_node->real_bits, |
532 | orig_node->last_real_seqno, | 536 | orig_node->last_real_seqno, |
533 | batman_packet->seqno); | 537 | batman_ogm_packet->seqno); |
534 | 538 | ||
535 | if (compare_eth(tmp_neigh_node->addr, ethhdr->h_source) && | 539 | if (compare_eth(tmp_neigh_node->addr, ethhdr->h_source) && |
536 | (tmp_neigh_node->if_incoming == if_incoming)) | 540 | (tmp_neigh_node->if_incoming == if_incoming)) |
@@ -551,8 +555,8 @@ static int count_real_packets(const struct ethhdr *ethhdr, | |||
551 | if (need_update) { | 555 | if (need_update) { |
552 | bat_dbg(DBG_BATMAN, bat_priv, | 556 | bat_dbg(DBG_BATMAN, bat_priv, |
553 | "updating last_seqno: old %d, new %d\n", | 557 | "updating last_seqno: old %d, new %d\n", |
554 | orig_node->last_real_seqno, batman_packet->seqno); | 558 | orig_node->last_real_seqno, batman_ogm_packet->seqno); |
555 | orig_node->last_real_seqno = batman_packet->seqno; | 559 | orig_node->last_real_seqno = batman_ogm_packet->seqno; |
556 | } | 560 | } |
557 | 561 | ||
558 | ret = is_duplicate; | 562 | ret = is_duplicate; |
@@ -564,7 +568,7 @@ out: | |||
564 | } | 568 | } |
565 | 569 | ||
566 | void receive_bat_packet(const struct ethhdr *ethhdr, | 570 | void receive_bat_packet(const struct ethhdr *ethhdr, |
567 | struct batman_packet *batman_packet, | 571 | struct batman_ogm_packet *batman_ogm_packet, |
568 | const unsigned char *tt_buff, | 572 | const unsigned char *tt_buff, |
569 | struct hard_iface *if_incoming) | 573 | struct hard_iface *if_incoming) |
570 | { | 574 | { |
@@ -587,31 +591,31 @@ void receive_bat_packet(const struct ethhdr *ethhdr, | |||
587 | * it as an additional length. | 591 | * it as an additional length. |
588 | * | 592 | * |
589 | * TODO: A more sane solution would be to have a bit in the | 593 | * TODO: A more sane solution would be to have a bit in the |
590 | * batman_packet to detect whether the packet is the last | 594 | * batman_ogm_packet to detect whether the packet is the last |
591 | * packet in an aggregation. Here we expect that the padding | 595 | * packet in an aggregation. Here we expect that the padding |
592 | * is always zero (or not 0x01) | 596 | * is always zero (or not 0x01) |
593 | */ | 597 | */ |
594 | if (batman_packet->packet_type != BAT_PACKET) | 598 | if (batman_ogm_packet->packet_type != BAT_OGM) |
595 | return; | 599 | return; |
596 | 600 | ||
597 | /* could be changed by schedule_own_packet() */ | 601 | /* could be changed by schedule_own_packet() */ |
598 | if_incoming_seqno = atomic_read(&if_incoming->seqno); | 602 | if_incoming_seqno = atomic_read(&if_incoming->seqno); |
599 | 603 | ||
600 | has_directlink_flag = (batman_packet->flags & DIRECTLINK ? 1 : 0); | 604 | has_directlink_flag = (batman_ogm_packet->flags & DIRECTLINK ? 1 : 0); |
601 | 605 | ||
602 | is_single_hop_neigh = (compare_eth(ethhdr->h_source, | 606 | is_single_hop_neigh = (compare_eth(ethhdr->h_source, |
603 | batman_packet->orig) ? 1 : 0); | 607 | batman_ogm_packet->orig) ? 1 : 0); |
604 | 608 | ||
605 | bat_dbg(DBG_BATMAN, bat_priv, | 609 | bat_dbg(DBG_BATMAN, bat_priv, |
606 | "Received BATMAN packet via NB: %pM, IF: %s [%pM] " | 610 | "Received BATMAN packet via NB: %pM, IF: %s [%pM] " |
607 | "(from OG: %pM, via prev OG: %pM, seqno %d, ttvn %u, " | 611 | "(from OG: %pM, via prev OG: %pM, seqno %d, ttvn %u, " |
608 | "crc %u, changes %u, td %d, TTL %d, V %d, IDF %d)\n", | 612 | "crc %u, changes %u, td %d, TTL %d, V %d, IDF %d)\n", |
609 | ethhdr->h_source, if_incoming->net_dev->name, | 613 | ethhdr->h_source, if_incoming->net_dev->name, |
610 | if_incoming->net_dev->dev_addr, batman_packet->orig, | 614 | if_incoming->net_dev->dev_addr, batman_ogm_packet->orig, |
611 | batman_packet->prev_sender, batman_packet->seqno, | 615 | batman_ogm_packet->prev_sender, batman_ogm_packet->seqno, |
612 | batman_packet->ttvn, batman_packet->tt_crc, | 616 | batman_ogm_packet->ttvn, batman_ogm_packet->tt_crc, |
613 | batman_packet->tt_num_changes, batman_packet->tq, | 617 | batman_ogm_packet->tt_num_changes, batman_ogm_packet->tq, |
614 | batman_packet->ttl, batman_packet->version, | 618 | batman_ogm_packet->ttl, batman_ogm_packet->version, |
615 | has_directlink_flag); | 619 | has_directlink_flag); |
616 | 620 | ||
617 | rcu_read_lock(); | 621 | rcu_read_lock(); |
@@ -626,11 +630,11 @@ void receive_bat_packet(const struct ethhdr *ethhdr, | |||
626 | hard_iface->net_dev->dev_addr)) | 630 | hard_iface->net_dev->dev_addr)) |
627 | is_my_addr = 1; | 631 | is_my_addr = 1; |
628 | 632 | ||
629 | if (compare_eth(batman_packet->orig, | 633 | if (compare_eth(batman_ogm_packet->orig, |
630 | hard_iface->net_dev->dev_addr)) | 634 | hard_iface->net_dev->dev_addr)) |
631 | is_my_orig = 1; | 635 | is_my_orig = 1; |
632 | 636 | ||
633 | if (compare_eth(batman_packet->prev_sender, | 637 | if (compare_eth(batman_ogm_packet->prev_sender, |
634 | hard_iface->net_dev->dev_addr)) | 638 | hard_iface->net_dev->dev_addr)) |
635 | is_my_oldorig = 1; | 639 | is_my_oldorig = 1; |
636 | 640 | ||
@@ -639,10 +643,10 @@ void receive_bat_packet(const struct ethhdr *ethhdr, | |||
639 | } | 643 | } |
640 | rcu_read_unlock(); | 644 | rcu_read_unlock(); |
641 | 645 | ||
642 | if (batman_packet->version != COMPAT_VERSION) { | 646 | if (batman_ogm_packet->version != COMPAT_VERSION) { |
643 | bat_dbg(DBG_BATMAN, bat_priv, | 647 | bat_dbg(DBG_BATMAN, bat_priv, |
644 | "Drop packet: incompatible batman version (%i)\n", | 648 | "Drop packet: incompatible batman version (%i)\n", |
645 | batman_packet->version); | 649 | batman_ogm_packet->version); |
646 | return; | 650 | return; |
647 | } | 651 | } |
648 | 652 | ||
@@ -674,13 +678,14 @@ void receive_bat_packet(const struct ethhdr *ethhdr, | |||
674 | /* save packet seqno for bidirectional check */ | 678 | /* save packet seqno for bidirectional check */ |
675 | if (has_directlink_flag && | 679 | if (has_directlink_flag && |
676 | compare_eth(if_incoming->net_dev->dev_addr, | 680 | compare_eth(if_incoming->net_dev->dev_addr, |
677 | batman_packet->orig)) { | 681 | batman_ogm_packet->orig)) { |
678 | offset = if_incoming->if_num * NUM_WORDS; | 682 | offset = if_incoming->if_num * NUM_WORDS; |
679 | 683 | ||
680 | spin_lock_bh(&orig_neigh_node->ogm_cnt_lock); | 684 | spin_lock_bh(&orig_neigh_node->ogm_cnt_lock); |
681 | word = &(orig_neigh_node->bcast_own[offset]); | 685 | word = &(orig_neigh_node->bcast_own[offset]); |
682 | bit_mark(word, | 686 | bit_mark(word, |
683 | if_incoming_seqno - batman_packet->seqno - 2); | 687 | if_incoming_seqno - |
688 | batman_ogm_packet->seqno - 2); | ||
684 | orig_neigh_node->bcast_own_sum[if_incoming->if_num] = | 689 | orig_neigh_node->bcast_own_sum[if_incoming->if_num] = |
685 | bit_packet_count(word); | 690 | bit_packet_count(word); |
686 | spin_unlock_bh(&orig_neigh_node->ogm_cnt_lock); | 691 | spin_unlock_bh(&orig_neigh_node->ogm_cnt_lock); |
@@ -699,11 +704,12 @@ void receive_bat_packet(const struct ethhdr *ethhdr, | |||
699 | return; | 704 | return; |
700 | } | 705 | } |
701 | 706 | ||
702 | orig_node = get_orig_node(bat_priv, batman_packet->orig); | 707 | orig_node = get_orig_node(bat_priv, batman_ogm_packet->orig); |
703 | if (!orig_node) | 708 | if (!orig_node) |
704 | return; | 709 | return; |
705 | 710 | ||
706 | is_duplicate = count_real_packets(ethhdr, batman_packet, if_incoming); | 711 | is_duplicate = count_real_packets(ethhdr, batman_ogm_packet, |
712 | if_incoming); | ||
707 | 713 | ||
708 | if (is_duplicate == -1) { | 714 | if (is_duplicate == -1) { |
709 | bat_dbg(DBG_BATMAN, bat_priv, | 715 | bat_dbg(DBG_BATMAN, bat_priv, |
@@ -712,7 +718,7 @@ void receive_bat_packet(const struct ethhdr *ethhdr, | |||
712 | goto out; | 718 | goto out; |
713 | } | 719 | } |
714 | 720 | ||
715 | if (batman_packet->tq == 0) { | 721 | if (batman_ogm_packet->tq == 0) { |
716 | bat_dbg(DBG_BATMAN, bat_priv, | 722 | bat_dbg(DBG_BATMAN, bat_priv, |
717 | "Drop packet: originator packet with tq equal 0\n"); | 723 | "Drop packet: originator packet with tq equal 0\n"); |
718 | goto out; | 724 | goto out; |
@@ -724,8 +730,9 @@ void receive_bat_packet(const struct ethhdr *ethhdr, | |||
724 | 730 | ||
725 | /* avoid temporary routing loops */ | 731 | /* avoid temporary routing loops */ |
726 | if (router && router_router && | 732 | if (router && router_router && |
727 | (compare_eth(router->addr, batman_packet->prev_sender)) && | 733 | (compare_eth(router->addr, batman_ogm_packet->prev_sender)) && |
728 | !(compare_eth(batman_packet->orig, batman_packet->prev_sender)) && | 734 | !(compare_eth(batman_ogm_packet->orig, |
735 | batman_ogm_packet->prev_sender)) && | ||
729 | (compare_eth(router->addr, router_router->addr))) { | 736 | (compare_eth(router->addr, router_router->addr))) { |
730 | bat_dbg(DBG_BATMAN, bat_priv, | 737 | bat_dbg(DBG_BATMAN, bat_priv, |
731 | "Drop packet: ignoring all rebroadcast packets that " | 738 | "Drop packet: ignoring all rebroadcast packets that " |
@@ -752,24 +759,25 @@ void receive_bat_packet(const struct ethhdr *ethhdr, | |||
752 | } | 759 | } |
753 | 760 | ||
754 | is_bidirectional = is_bidirectional_neigh(orig_node, orig_neigh_node, | 761 | is_bidirectional = is_bidirectional_neigh(orig_node, orig_neigh_node, |
755 | batman_packet, if_incoming); | 762 | batman_ogm_packet, |
763 | if_incoming); | ||
756 | 764 | ||
757 | bonding_save_primary(orig_node, orig_neigh_node, batman_packet); | 765 | bonding_save_primary(orig_node, orig_neigh_node, batman_ogm_packet); |
758 | 766 | ||
759 | /* update ranking if it is not a duplicate or has the same | 767 | /* update ranking if it is not a duplicate or has the same |
760 | * seqno and similar ttl as the non-duplicate */ | 768 | * seqno and similar ttl as the non-duplicate */ |
761 | if (is_bidirectional && | 769 | if (is_bidirectional && |
762 | (!is_duplicate || | 770 | (!is_duplicate || |
763 | ((orig_node->last_real_seqno == batman_packet->seqno) && | 771 | ((orig_node->last_real_seqno == batman_ogm_packet->seqno) && |
764 | (orig_node->last_ttl - 3 <= batman_packet->ttl)))) | 772 | (orig_node->last_ttl - 3 <= batman_ogm_packet->ttl)))) |
765 | update_orig(bat_priv, orig_node, ethhdr, batman_packet, | 773 | update_orig(bat_priv, orig_node, ethhdr, batman_ogm_packet, |
766 | if_incoming, tt_buff, is_duplicate); | 774 | if_incoming, tt_buff, is_duplicate); |
767 | 775 | ||
768 | /* is single hop (direct) neighbor */ | 776 | /* is single hop (direct) neighbor */ |
769 | if (is_single_hop_neigh) { | 777 | if (is_single_hop_neigh) { |
770 | 778 | ||
771 | /* mark direct link on incoming interface */ | 779 | /* mark direct link on incoming interface */ |
772 | schedule_forward_packet(orig_node, ethhdr, batman_packet, | 780 | schedule_forward_packet(orig_node, ethhdr, batman_ogm_packet, |
773 | 1, if_incoming); | 781 | 1, if_incoming); |
774 | 782 | ||
775 | bat_dbg(DBG_BATMAN, bat_priv, "Forwarding packet: " | 783 | bat_dbg(DBG_BATMAN, bat_priv, "Forwarding packet: " |
@@ -792,7 +800,7 @@ void receive_bat_packet(const struct ethhdr *ethhdr, | |||
792 | 800 | ||
793 | bat_dbg(DBG_BATMAN, bat_priv, | 801 | bat_dbg(DBG_BATMAN, bat_priv, |
794 | "Forwarding packet: rebroadcast originator packet\n"); | 802 | "Forwarding packet: rebroadcast originator packet\n"); |
795 | schedule_forward_packet(orig_node, ethhdr, batman_packet, | 803 | schedule_forward_packet(orig_node, ethhdr, batman_ogm_packet, |
796 | 0, if_incoming); | 804 | 0, if_incoming); |
797 | 805 | ||
798 | out_neigh: | 806 | out_neigh: |
@@ -814,7 +822,7 @@ int recv_bat_packet(struct sk_buff *skb, struct hard_iface *hard_iface) | |||
814 | struct ethhdr *ethhdr; | 822 | struct ethhdr *ethhdr; |
815 | 823 | ||
816 | /* drop packet if it has not necessary minimum size */ | 824 | /* drop packet if it has not necessary minimum size */ |
817 | if (unlikely(!pskb_may_pull(skb, sizeof(struct batman_packet)))) | 825 | if (unlikely(!pskb_may_pull(skb, BATMAN_OGM_LEN))) |
818 | return NET_RX_DROP; | 826 | return NET_RX_DROP; |
819 | 827 | ||
820 | ethhdr = (struct ethhdr *)skb_mac_header(skb); | 828 | ethhdr = (struct ethhdr *)skb_mac_header(skb); |
diff --git a/net/batman-adv/routing.h b/net/batman-adv/routing.h index fb14e9579b19..893db7f6007b 100644 --- a/net/batman-adv/routing.h +++ b/net/batman-adv/routing.h | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | void slide_own_bcast_window(struct hard_iface *hard_iface); | 25 | void slide_own_bcast_window(struct hard_iface *hard_iface); |
26 | void receive_bat_packet(const struct ethhdr *ethhdr, | 26 | void receive_bat_packet(const struct ethhdr *ethhdr, |
27 | struct batman_packet *batman_packet, | 27 | struct batman_ogm_packet *batman_ogm_packet, |
28 | const unsigned char *tt_buff, | 28 | const unsigned char *tt_buff, |
29 | struct hard_iface *if_incoming); | 29 | struct hard_iface *if_incoming); |
30 | void update_routes(struct bat_priv *bat_priv, struct orig_node *orig_node, | 30 | void update_routes(struct bat_priv *bat_priv, struct orig_node *orig_node, |
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c index 57ae80936911..40a5fcd67136 100644 --- a/net/batman-adv/send.c +++ b/net/batman-adv/send.c | |||
@@ -107,7 +107,7 @@ static void send_packet_to_if(struct forw_packet *forw_packet, | |||
107 | char *fwd_str; | 107 | char *fwd_str; |
108 | uint8_t packet_num; | 108 | uint8_t packet_num; |
109 | int16_t buff_pos; | 109 | int16_t buff_pos; |
110 | struct batman_packet *batman_packet; | 110 | struct batman_ogm_packet *batman_ogm_packet; |
111 | struct sk_buff *skb; | 111 | struct sk_buff *skb; |
112 | 112 | ||
113 | if (hard_iface->if_status != IF_ACTIVE) | 113 | if (hard_iface->if_status != IF_ACTIVE) |
@@ -115,20 +115,20 @@ static void send_packet_to_if(struct forw_packet *forw_packet, | |||
115 | 115 | ||
116 | packet_num = 0; | 116 | packet_num = 0; |
117 | buff_pos = 0; | 117 | buff_pos = 0; |
118 | batman_packet = (struct batman_packet *)forw_packet->skb->data; | 118 | batman_ogm_packet = (struct batman_ogm_packet *)forw_packet->skb->data; |
119 | 119 | ||
120 | /* adjust all flags and log packets */ | 120 | /* adjust all flags and log packets */ |
121 | while (aggregated_packet(buff_pos, | 121 | while (aggregated_packet(buff_pos, |
122 | forw_packet->packet_len, | 122 | forw_packet->packet_len, |
123 | batman_packet->tt_num_changes)) { | 123 | batman_ogm_packet->tt_num_changes)) { |
124 | 124 | ||
125 | /* we might have aggregated direct link packets with an | 125 | /* we might have aggregated direct link packets with an |
126 | * ordinary base packet */ | 126 | * ordinary base packet */ |
127 | if ((forw_packet->direct_link_flags & (1 << packet_num)) && | 127 | if ((forw_packet->direct_link_flags & (1 << packet_num)) && |
128 | (forw_packet->if_incoming == hard_iface)) | 128 | (forw_packet->if_incoming == hard_iface)) |
129 | batman_packet->flags |= DIRECTLINK; | 129 | batman_ogm_packet->flags |= DIRECTLINK; |
130 | else | 130 | else |
131 | batman_packet->flags &= ~DIRECTLINK; | 131 | batman_ogm_packet->flags &= ~DIRECTLINK; |
132 | 132 | ||
133 | fwd_str = (packet_num > 0 ? "Forwarding" : (forw_packet->own ? | 133 | fwd_str = (packet_num > 0 ? "Forwarding" : (forw_packet->own ? |
134 | "Sending own" : | 134 | "Sending own" : |
@@ -137,18 +137,19 @@ static void send_packet_to_if(struct forw_packet *forw_packet, | |||
137 | "%s %spacket (originator %pM, seqno %d, TQ %d, TTL %d," | 137 | "%s %spacket (originator %pM, seqno %d, TQ %d, TTL %d," |
138 | " IDF %s, ttvn %d) on interface %s [%pM]\n", | 138 | " IDF %s, ttvn %d) on interface %s [%pM]\n", |
139 | fwd_str, (packet_num > 0 ? "aggregated " : ""), | 139 | fwd_str, (packet_num > 0 ? "aggregated " : ""), |
140 | batman_packet->orig, ntohl(batman_packet->seqno), | 140 | batman_ogm_packet->orig, |
141 | batman_packet->tq, batman_packet->ttl, | 141 | ntohl(batman_ogm_packet->seqno), |
142 | (batman_packet->flags & DIRECTLINK ? | 142 | batman_ogm_packet->tq, batman_ogm_packet->ttl, |
143 | (batman_ogm_packet->flags & DIRECTLINK ? | ||
143 | "on" : "off"), | 144 | "on" : "off"), |
144 | batman_packet->ttvn, hard_iface->net_dev->name, | 145 | batman_ogm_packet->ttvn, hard_iface->net_dev->name, |
145 | hard_iface->net_dev->dev_addr); | 146 | hard_iface->net_dev->dev_addr); |
146 | 147 | ||
147 | buff_pos += sizeof(*batman_packet) + | 148 | buff_pos += BATMAN_OGM_LEN + |
148 | tt_len(batman_packet->tt_num_changes); | 149 | tt_len(batman_ogm_packet->tt_num_changes); |
149 | packet_num++; | 150 | packet_num++; |
150 | batman_packet = (struct batman_packet *) | 151 | batman_ogm_packet = (struct batman_ogm_packet *) |
151 | (forw_packet->skb->data + buff_pos); | 152 | (forw_packet->skb->data + buff_pos); |
152 | } | 153 | } |
153 | 154 | ||
154 | /* create clone because function is called more than once */ | 155 | /* create clone because function is called more than once */ |
@@ -164,9 +165,11 @@ static void send_packet(struct forw_packet *forw_packet) | |||
164 | struct net_device *soft_iface; | 165 | struct net_device *soft_iface; |
165 | struct bat_priv *bat_priv; | 166 | struct bat_priv *bat_priv; |
166 | struct hard_iface *primary_if = NULL; | 167 | struct hard_iface *primary_if = NULL; |
167 | struct batman_packet *batman_packet = | 168 | struct batman_ogm_packet *batman_ogm_packet = |
168 | (struct batman_packet *)(forw_packet->skb->data); | 169 | (struct batman_ogm_packet *)(forw_packet->skb->data); |
169 | int directlink = (batman_packet->flags & DIRECTLINK ? 1 : 0); | 170 | unsigned char directlink; |
171 | |||
172 | directlink = (batman_ogm_packet->flags & DIRECTLINK ? 1 : 0); | ||
170 | 173 | ||
171 | if (!forw_packet->if_incoming) { | 174 | if (!forw_packet->if_incoming) { |
172 | pr_err("Error - can't forward packet: incoming iface not " | 175 | pr_err("Error - can't forward packet: incoming iface not " |
@@ -186,7 +189,7 @@ static void send_packet(struct forw_packet *forw_packet) | |||
186 | 189 | ||
187 | /* multihomed peer assumed */ | 190 | /* multihomed peer assumed */ |
188 | /* non-primary OGMs are only broadcasted on their interface */ | 191 | /* non-primary OGMs are only broadcasted on their interface */ |
189 | if ((directlink && (batman_packet->ttl == 1)) || | 192 | if ((directlink && (batman_ogm_packet->ttl == 1)) || |
190 | (forw_packet->own && (forw_packet->if_incoming != primary_if))) { | 193 | (forw_packet->own && (forw_packet->if_incoming != primary_if))) { |
191 | 194 | ||
192 | /* FIXME: what about aggregated packets ? */ | 195 | /* FIXME: what about aggregated packets ? */ |
@@ -194,8 +197,9 @@ static void send_packet(struct forw_packet *forw_packet) | |||
194 | "%s packet (originator %pM, seqno %d, TTL %d) " | 197 | "%s packet (originator %pM, seqno %d, TTL %d) " |
195 | "on interface %s [%pM]\n", | 198 | "on interface %s [%pM]\n", |
196 | (forw_packet->own ? "Sending own" : "Forwarding"), | 199 | (forw_packet->own ? "Sending own" : "Forwarding"), |
197 | batman_packet->orig, ntohl(batman_packet->seqno), | 200 | batman_ogm_packet->orig, |
198 | batman_packet->ttl, | 201 | ntohl(batman_ogm_packet->seqno), |
202 | batman_ogm_packet->ttl, | ||
199 | forw_packet->if_incoming->net_dev->name, | 203 | forw_packet->if_incoming->net_dev->name, |
200 | forw_packet->if_incoming->net_dev->dev_addr); | 204 | forw_packet->if_incoming->net_dev->dev_addr); |
201 | 205 | ||
@@ -223,17 +227,16 @@ out: | |||
223 | } | 227 | } |
224 | 228 | ||
225 | static void realloc_packet_buffer(struct hard_iface *hard_iface, | 229 | static void realloc_packet_buffer(struct hard_iface *hard_iface, |
226 | int new_len) | 230 | int new_len) |
227 | { | 231 | { |
228 | unsigned char *new_buff; | 232 | unsigned char *new_buff; |
229 | struct batman_packet *batman_packet; | ||
230 | 233 | ||
231 | new_buff = kmalloc(new_len, GFP_ATOMIC); | 234 | new_buff = kmalloc(new_len, GFP_ATOMIC); |
232 | 235 | ||
233 | /* keep old buffer if kmalloc should fail */ | 236 | /* keep old buffer if kmalloc should fail */ |
234 | if (new_buff) { | 237 | if (new_buff) { |
235 | memcpy(new_buff, hard_iface->packet_buff, | 238 | memcpy(new_buff, hard_iface->packet_buff, |
236 | sizeof(*batman_packet)); | 239 | BATMAN_OGM_LEN); |
237 | 240 | ||
238 | kfree(hard_iface->packet_buff); | 241 | kfree(hard_iface->packet_buff); |
239 | hard_iface->packet_buff = new_buff; | 242 | hard_iface->packet_buff = new_buff; |
@@ -246,39 +249,39 @@ static void prepare_packet_buffer(struct bat_priv *bat_priv, | |||
246 | struct hard_iface *hard_iface) | 249 | struct hard_iface *hard_iface) |
247 | { | 250 | { |
248 | int new_len; | 251 | int new_len; |
249 | struct batman_packet *batman_packet; | 252 | struct batman_ogm_packet *batman_ogm_packet; |
250 | 253 | ||
251 | new_len = BAT_PACKET_LEN + | 254 | new_len = BATMAN_OGM_LEN + |
252 | tt_len((uint8_t)atomic_read(&bat_priv->tt_local_changes)); | 255 | tt_len((uint8_t)atomic_read(&bat_priv->tt_local_changes)); |
253 | 256 | ||
254 | /* if we have too many changes for one packet don't send any | 257 | /* if we have too many changes for one packet don't send any |
255 | * and wait for the tt table request which will be fragmented */ | 258 | * and wait for the tt table request which will be fragmented */ |
256 | if (new_len > hard_iface->soft_iface->mtu) | 259 | if (new_len > hard_iface->soft_iface->mtu) |
257 | new_len = BAT_PACKET_LEN; | 260 | new_len = BATMAN_OGM_LEN; |
258 | 261 | ||
259 | realloc_packet_buffer(hard_iface, new_len); | 262 | realloc_packet_buffer(hard_iface, new_len); |
260 | batman_packet = (struct batman_packet *)hard_iface->packet_buff; | 263 | batman_ogm_packet = (struct batman_ogm_packet *)hard_iface->packet_buff; |
261 | 264 | ||
262 | atomic_set(&bat_priv->tt_crc, tt_local_crc(bat_priv)); | 265 | atomic_set(&bat_priv->tt_crc, tt_local_crc(bat_priv)); |
263 | 266 | ||
264 | /* reset the sending counter */ | 267 | /* reset the sending counter */ |
265 | atomic_set(&bat_priv->tt_ogm_append_cnt, TT_OGM_APPEND_MAX); | 268 | atomic_set(&bat_priv->tt_ogm_append_cnt, TT_OGM_APPEND_MAX); |
266 | 269 | ||
267 | batman_packet->tt_num_changes = tt_changes_fill_buffer(bat_priv, | 270 | batman_ogm_packet->tt_num_changes = tt_changes_fill_buffer(bat_priv, |
268 | hard_iface->packet_buff + BAT_PACKET_LEN, | 271 | hard_iface->packet_buff + BATMAN_OGM_LEN, |
269 | hard_iface->packet_len - BAT_PACKET_LEN); | 272 | hard_iface->packet_len - BATMAN_OGM_LEN); |
270 | 273 | ||
271 | } | 274 | } |
272 | 275 | ||
273 | static void reset_packet_buffer(struct bat_priv *bat_priv, | 276 | static void reset_packet_buffer(struct bat_priv *bat_priv, |
274 | struct hard_iface *hard_iface) | 277 | struct hard_iface *hard_iface) |
275 | { | 278 | { |
276 | struct batman_packet *batman_packet; | 279 | struct batman_ogm_packet *batman_ogm_packet; |
277 | 280 | ||
278 | realloc_packet_buffer(hard_iface, BAT_PACKET_LEN); | 281 | realloc_packet_buffer(hard_iface, BATMAN_OGM_LEN); |
279 | 282 | ||
280 | batman_packet = (struct batman_packet *)hard_iface->packet_buff; | 283 | batman_ogm_packet = (struct batman_ogm_packet *)hard_iface->packet_buff; |
281 | batman_packet->tt_num_changes = 0; | 284 | batman_ogm_packet->tt_num_changes = 0; |
282 | } | 285 | } |
283 | 286 | ||
284 | void schedule_own_packet(struct hard_iface *hard_iface) | 287 | void schedule_own_packet(struct hard_iface *hard_iface) |
@@ -286,7 +289,7 @@ void schedule_own_packet(struct hard_iface *hard_iface) | |||
286 | struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); | 289 | struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); |
287 | struct hard_iface *primary_if; | 290 | struct hard_iface *primary_if; |
288 | unsigned long send_time; | 291 | unsigned long send_time; |
289 | struct batman_packet *batman_packet; | 292 | struct batman_ogm_packet *batman_ogm_packet; |
290 | int vis_server; | 293 | int vis_server; |
291 | 294 | ||
292 | if ((hard_iface->if_status == IF_NOT_IN_USE) || | 295 | if ((hard_iface->if_status == IF_NOT_IN_USE) || |
@@ -322,26 +325,27 @@ void schedule_own_packet(struct hard_iface *hard_iface) | |||
322 | * NOTE: packet_buff might just have been re-allocated in | 325 | * NOTE: packet_buff might just have been re-allocated in |
323 | * prepare_packet_buffer() or in reset_packet_buffer() | 326 | * prepare_packet_buffer() or in reset_packet_buffer() |
324 | */ | 327 | */ |
325 | batman_packet = (struct batman_packet *)hard_iface->packet_buff; | 328 | batman_ogm_packet = (struct batman_ogm_packet *)hard_iface->packet_buff; |
326 | 329 | ||
327 | /* change sequence number to network order */ | 330 | /* change sequence number to network order */ |
328 | batman_packet->seqno = | 331 | batman_ogm_packet->seqno = |
329 | htonl((uint32_t)atomic_read(&hard_iface->seqno)); | 332 | htonl((uint32_t)atomic_read(&hard_iface->seqno)); |
330 | 333 | ||
331 | batman_packet->ttvn = atomic_read(&bat_priv->ttvn); | 334 | batman_ogm_packet->ttvn = atomic_read(&bat_priv->ttvn); |
332 | batman_packet->tt_crc = htons((uint16_t)atomic_read(&bat_priv->tt_crc)); | 335 | batman_ogm_packet->tt_crc = htons((uint16_t) |
336 | atomic_read(&bat_priv->tt_crc)); | ||
333 | 337 | ||
334 | if (vis_server == VIS_TYPE_SERVER_SYNC) | 338 | if (vis_server == VIS_TYPE_SERVER_SYNC) |
335 | batman_packet->flags |= VIS_SERVER; | 339 | batman_ogm_packet->flags |= VIS_SERVER; |
336 | else | 340 | else |
337 | batman_packet->flags &= ~VIS_SERVER; | 341 | batman_ogm_packet->flags &= ~VIS_SERVER; |
338 | 342 | ||
339 | if ((hard_iface == primary_if) && | 343 | if ((hard_iface == primary_if) && |
340 | (atomic_read(&bat_priv->gw_mode) == GW_MODE_SERVER)) | 344 | (atomic_read(&bat_priv->gw_mode) == GW_MODE_SERVER)) |
341 | batman_packet->gw_flags = | 345 | batman_ogm_packet->gw_flags = |
342 | (uint8_t)atomic_read(&bat_priv->gw_bandwidth); | 346 | (uint8_t)atomic_read(&bat_priv->gw_bandwidth); |
343 | else | 347 | else |
344 | batman_packet->gw_flags = NO_FLAGS; | 348 | batman_ogm_packet->gw_flags = NO_FLAGS; |
345 | 349 | ||
346 | atomic_inc(&hard_iface->seqno); | 350 | atomic_inc(&hard_iface->seqno); |
347 | 351 | ||
@@ -358,7 +362,7 @@ void schedule_own_packet(struct hard_iface *hard_iface) | |||
358 | 362 | ||
359 | void schedule_forward_packet(struct orig_node *orig_node, | 363 | void schedule_forward_packet(struct orig_node *orig_node, |
360 | const struct ethhdr *ethhdr, | 364 | const struct ethhdr *ethhdr, |
361 | struct batman_packet *batman_packet, | 365 | struct batman_ogm_packet *batman_ogm_packet, |
362 | int directlink, | 366 | int directlink, |
363 | struct hard_iface *if_incoming) | 367 | struct hard_iface *if_incoming) |
364 | { | 368 | { |
@@ -368,19 +372,19 @@ void schedule_forward_packet(struct orig_node *orig_node, | |||
368 | unsigned long send_time; | 372 | unsigned long send_time; |
369 | uint8_t tt_num_changes; | 373 | uint8_t tt_num_changes; |
370 | 374 | ||
371 | if (batman_packet->ttl <= 1) { | 375 | if (batman_ogm_packet->ttl <= 1) { |
372 | bat_dbg(DBG_BATMAN, bat_priv, "ttl exceeded\n"); | 376 | bat_dbg(DBG_BATMAN, bat_priv, "ttl exceeded\n"); |
373 | return; | 377 | return; |
374 | } | 378 | } |
375 | 379 | ||
376 | router = orig_node_get_router(orig_node); | 380 | router = orig_node_get_router(orig_node); |
377 | 381 | ||
378 | in_tq = batman_packet->tq; | 382 | in_tq = batman_ogm_packet->tq; |
379 | in_ttl = batman_packet->ttl; | 383 | in_ttl = batman_ogm_packet->ttl; |
380 | tt_num_changes = batman_packet->tt_num_changes; | 384 | tt_num_changes = batman_ogm_packet->tt_num_changes; |
381 | 385 | ||
382 | batman_packet->ttl--; | 386 | batman_ogm_packet->ttl--; |
383 | memcpy(batman_packet->prev_sender, ethhdr->h_source, ETH_ALEN); | 387 | memcpy(batman_ogm_packet->prev_sender, ethhdr->h_source, ETH_ALEN); |
384 | 388 | ||
385 | /* rebroadcast tq of our best ranking neighbor to ensure the rebroadcast | 389 | /* rebroadcast tq of our best ranking neighbor to ensure the rebroadcast |
386 | * of our best tq value */ | 390 | * of our best tq value */ |
@@ -388,10 +392,10 @@ void schedule_forward_packet(struct orig_node *orig_node, | |||
388 | 392 | ||
389 | /* rebroadcast ogm of best ranking neighbor as is */ | 393 | /* rebroadcast ogm of best ranking neighbor as is */ |
390 | if (!compare_eth(router->addr, ethhdr->h_source)) { | 394 | if (!compare_eth(router->addr, ethhdr->h_source)) { |
391 | batman_packet->tq = router->tq_avg; | 395 | batman_ogm_packet->tq = router->tq_avg; |
392 | 396 | ||
393 | if (router->last_ttl) | 397 | if (router->last_ttl) |
394 | batman_packet->ttl = router->last_ttl - 1; | 398 | batman_ogm_packet->ttl = router->last_ttl - 1; |
395 | } | 399 | } |
396 | 400 | ||
397 | tq_avg = router->tq_avg; | 401 | tq_avg = router->tq_avg; |
@@ -401,28 +405,28 @@ void schedule_forward_packet(struct orig_node *orig_node, | |||
401 | neigh_node_free_ref(router); | 405 | neigh_node_free_ref(router); |
402 | 406 | ||
403 | /* apply hop penalty */ | 407 | /* apply hop penalty */ |
404 | batman_packet->tq = hop_penalty(batman_packet->tq, bat_priv); | 408 | batman_ogm_packet->tq = hop_penalty(batman_ogm_packet->tq, bat_priv); |
405 | 409 | ||
406 | bat_dbg(DBG_BATMAN, bat_priv, | 410 | bat_dbg(DBG_BATMAN, bat_priv, |
407 | "Forwarding packet: tq_orig: %i, tq_avg: %i, " | 411 | "Forwarding packet: tq_orig: %i, tq_avg: %i, " |
408 | "tq_forw: %i, ttl_orig: %i, ttl_forw: %i\n", | 412 | "tq_forw: %i, ttl_orig: %i, ttl_forw: %i\n", |
409 | in_tq, tq_avg, batman_packet->tq, in_ttl - 1, | 413 | in_tq, tq_avg, batman_ogm_packet->tq, in_ttl - 1, |
410 | batman_packet->ttl); | 414 | batman_ogm_packet->ttl); |
411 | 415 | ||
412 | batman_packet->seqno = htonl(batman_packet->seqno); | 416 | batman_ogm_packet->seqno = htonl(batman_ogm_packet->seqno); |
413 | batman_packet->tt_crc = htons(batman_packet->tt_crc); | 417 | batman_ogm_packet->tt_crc = htons(batman_ogm_packet->tt_crc); |
414 | 418 | ||
415 | /* switch of primaries first hop flag when forwarding */ | 419 | /* switch of primaries first hop flag when forwarding */ |
416 | batman_packet->flags &= ~PRIMARIES_FIRST_HOP; | 420 | batman_ogm_packet->flags &= ~PRIMARIES_FIRST_HOP; |
417 | if (directlink) | 421 | if (directlink) |
418 | batman_packet->flags |= DIRECTLINK; | 422 | batman_ogm_packet->flags |= DIRECTLINK; |
419 | else | 423 | else |
420 | batman_packet->flags &= ~DIRECTLINK; | 424 | batman_ogm_packet->flags &= ~DIRECTLINK; |
421 | 425 | ||
422 | send_time = forward_send_time(); | 426 | send_time = forward_send_time(); |
423 | add_bat_packet_to_list(bat_priv, | 427 | add_bat_packet_to_list(bat_priv, |
424 | (unsigned char *)batman_packet, | 428 | (unsigned char *)batman_ogm_packet, |
425 | sizeof(*batman_packet) + tt_len(tt_num_changes), | 429 | BATMAN_OGM_LEN + tt_len(tt_num_changes), |
426 | if_incoming, 0, send_time); | 430 | if_incoming, 0, send_time); |
427 | } | 431 | } |
428 | 432 | ||
diff --git a/net/batman-adv/send.h b/net/batman-adv/send.h index 1f2d1e877663..8a22d841b2ea 100644 --- a/net/batman-adv/send.h +++ b/net/batman-adv/send.h | |||
@@ -27,7 +27,7 @@ int send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface, | |||
27 | void schedule_own_packet(struct hard_iface *hard_iface); | 27 | void schedule_own_packet(struct hard_iface *hard_iface); |
28 | void schedule_forward_packet(struct orig_node *orig_node, | 28 | void schedule_forward_packet(struct orig_node *orig_node, |
29 | const struct ethhdr *ethhdr, | 29 | const struct ethhdr *ethhdr, |
30 | struct batman_packet *batman_packet, | 30 | struct batman_ogm_packet *batman_ogm_packet, |
31 | int directlink, | 31 | int directlink, |
32 | struct hard_iface *if_outgoing); | 32 | struct hard_iface *if_outgoing); |
33 | int add_bcast_packet_to_list(struct bat_priv *bat_priv, | 33 | int add_bcast_packet_to_list(struct bat_priv *bat_priv, |
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index 402fd96239d8..7d8332ec44d0 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c | |||
@@ -445,30 +445,31 @@ static void softif_batman_recv(struct sk_buff *skb, struct net_device *dev, | |||
445 | { | 445 | { |
446 | struct bat_priv *bat_priv = netdev_priv(dev); | 446 | struct bat_priv *bat_priv = netdev_priv(dev); |
447 | struct ethhdr *ethhdr = (struct ethhdr *)skb->data; | 447 | struct ethhdr *ethhdr = (struct ethhdr *)skb->data; |
448 | struct batman_packet *batman_packet; | 448 | struct batman_ogm_packet *batman_ogm_packet; |
449 | struct softif_neigh *softif_neigh = NULL; | 449 | struct softif_neigh *softif_neigh = NULL; |
450 | struct hard_iface *primary_if = NULL; | 450 | struct hard_iface *primary_if = NULL; |
451 | struct softif_neigh *curr_softif_neigh = NULL; | 451 | struct softif_neigh *curr_softif_neigh = NULL; |
452 | 452 | ||
453 | if (ntohs(ethhdr->h_proto) == ETH_P_8021Q) | 453 | if (ntohs(ethhdr->h_proto) == ETH_P_8021Q) |
454 | batman_packet = (struct batman_packet *) | 454 | batman_ogm_packet = (struct batman_ogm_packet *) |
455 | (skb->data + ETH_HLEN + VLAN_HLEN); | 455 | (skb->data + ETH_HLEN + VLAN_HLEN); |
456 | else | 456 | else |
457 | batman_packet = (struct batman_packet *)(skb->data + ETH_HLEN); | 457 | batman_ogm_packet = (struct batman_ogm_packet *) |
458 | (skb->data + ETH_HLEN); | ||
458 | 459 | ||
459 | if (batman_packet->version != COMPAT_VERSION) | 460 | if (batman_ogm_packet->version != COMPAT_VERSION) |
460 | goto out; | 461 | goto out; |
461 | 462 | ||
462 | if (batman_packet->packet_type != BAT_PACKET) | 463 | if (batman_ogm_packet->packet_type != BAT_OGM) |
463 | goto out; | 464 | goto out; |
464 | 465 | ||
465 | if (!(batman_packet->flags & PRIMARIES_FIRST_HOP)) | 466 | if (!(batman_ogm_packet->flags & PRIMARIES_FIRST_HOP)) |
466 | goto out; | 467 | goto out; |
467 | 468 | ||
468 | if (is_my_mac(batman_packet->orig)) | 469 | if (is_my_mac(batman_ogm_packet->orig)) |
469 | goto out; | 470 | goto out; |
470 | 471 | ||
471 | softif_neigh = softif_neigh_get(bat_priv, batman_packet->orig, vid); | 472 | softif_neigh = softif_neigh_get(bat_priv, batman_ogm_packet->orig, vid); |
472 | if (!softif_neigh) | 473 | if (!softif_neigh) |
473 | goto out; | 474 | goto out; |
474 | 475 | ||