diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2012-02-07 04:20:50 -0500 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-04-18 03:54:00 -0400 |
commit | 76e3d7fc1a49ea8c377ddc91a4ec40f326404833 (patch) | |
tree | 297060a4b0651ab2d5744130cbda20e9953bc412 /net/batman-adv | |
parent | cd8b78e7e9d1d9625634dc1ec2bb4b5a14d1295a (diff) |
batman-adv: rename BATMAN_OGM_LEN to BATMAN_OGM_HLEN
Using BATMAN_OGM_LEN leaves one with the impression that this is
the full packet size which is not the case. Therefore the variable
is renamed.
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv')
-rw-r--r-- | net/batman-adv/bat_iv_ogm.c | 12 | ||||
-rw-r--r-- | net/batman-adv/packet.h | 2 | ||||
-rw-r--r-- | net/batman-adv/routing.c | 2 | ||||
-rw-r--r-- | net/batman-adv/send.c | 12 |
4 files changed, 14 insertions, 14 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c index c0bdb90cc024..a2af2896769f 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c | |||
@@ -40,7 +40,7 @@ static int bat_iv_ogm_iface_enable(struct hard_iface *hard_iface) | |||
40 | get_random_bytes(&random_seqno, sizeof(random_seqno)); | 40 | get_random_bytes(&random_seqno, sizeof(random_seqno)); |
41 | atomic_set(&hard_iface->seqno, random_seqno); | 41 | atomic_set(&hard_iface->seqno, random_seqno); |
42 | 42 | ||
43 | hard_iface->packet_len = BATMAN_OGM_LEN; | 43 | hard_iface->packet_len = BATMAN_OGM_HLEN; |
44 | hard_iface->packet_buff = kmalloc(hard_iface->packet_len, GFP_ATOMIC); | 44 | hard_iface->packet_buff = kmalloc(hard_iface->packet_len, GFP_ATOMIC); |
45 | 45 | ||
46 | if (!hard_iface->packet_buff) | 46 | if (!hard_iface->packet_buff) |
@@ -112,7 +112,7 @@ static uint8_t hop_penalty(uint8_t tq, const struct bat_priv *bat_priv) | |||
112 | static int bat_iv_ogm_aggr_packet(int buff_pos, int packet_len, | 112 | static int bat_iv_ogm_aggr_packet(int buff_pos, int packet_len, |
113 | int tt_num_changes) | 113 | int tt_num_changes) |
114 | { | 114 | { |
115 | int next_buff_pos = buff_pos + BATMAN_OGM_LEN + tt_len(tt_num_changes); | 115 | int next_buff_pos = buff_pos + BATMAN_OGM_HLEN + tt_len(tt_num_changes); |
116 | 116 | ||
117 | return (next_buff_pos <= packet_len) && | 117 | return (next_buff_pos <= packet_len) && |
118 | (next_buff_pos <= MAX_AGGREGATION_BYTES); | 118 | (next_buff_pos <= MAX_AGGREGATION_BYTES); |
@@ -162,7 +162,7 @@ static void bat_iv_ogm_send_to_if(struct forw_packet *forw_packet, | |||
162 | batman_ogm_packet->ttvn, hard_iface->net_dev->name, | 162 | batman_ogm_packet->ttvn, hard_iface->net_dev->name, |
163 | hard_iface->net_dev->dev_addr); | 163 | hard_iface->net_dev->dev_addr); |
164 | 164 | ||
165 | buff_pos += BATMAN_OGM_LEN + | 165 | buff_pos += BATMAN_OGM_HLEN + |
166 | tt_len(batman_ogm_packet->tt_num_changes); | 166 | tt_len(batman_ogm_packet->tt_num_changes); |
167 | packet_num++; | 167 | packet_num++; |
168 | batman_ogm_packet = (struct batman_ogm_packet *) | 168 | batman_ogm_packet = (struct batman_ogm_packet *) |
@@ -540,7 +540,7 @@ static void bat_iv_ogm_forward(struct orig_node *orig_node, | |||
540 | batman_ogm_packet->flags &= ~DIRECTLINK; | 540 | batman_ogm_packet->flags &= ~DIRECTLINK; |
541 | 541 | ||
542 | bat_iv_ogm_queue_add(bat_priv, (unsigned char *)batman_ogm_packet, | 542 | bat_iv_ogm_queue_add(bat_priv, (unsigned char *)batman_ogm_packet, |
543 | BATMAN_OGM_LEN + tt_len(tt_num_changes), | 543 | BATMAN_OGM_HLEN + tt_len(tt_num_changes), |
544 | if_incoming, 0, bat_iv_ogm_fwd_send_time()); | 544 | if_incoming, 0, bat_iv_ogm_fwd_send_time()); |
545 | } | 545 | } |
546 | 546 | ||
@@ -1173,12 +1173,12 @@ static void bat_iv_ogm_receive(struct hard_iface *if_incoming, | |||
1173 | batman_ogm_packet->seqno = ntohl(batman_ogm_packet->seqno); | 1173 | batman_ogm_packet->seqno = ntohl(batman_ogm_packet->seqno); |
1174 | batman_ogm_packet->tt_crc = ntohs(batman_ogm_packet->tt_crc); | 1174 | batman_ogm_packet->tt_crc = ntohs(batman_ogm_packet->tt_crc); |
1175 | 1175 | ||
1176 | tt_buff = packet_buff + buff_pos + BATMAN_OGM_LEN; | 1176 | tt_buff = packet_buff + buff_pos + BATMAN_OGM_HLEN; |
1177 | 1177 | ||
1178 | bat_iv_ogm_process(ethhdr, batman_ogm_packet, | 1178 | bat_iv_ogm_process(ethhdr, batman_ogm_packet, |
1179 | tt_buff, if_incoming); | 1179 | tt_buff, if_incoming); |
1180 | 1180 | ||
1181 | buff_pos += BATMAN_OGM_LEN + | 1181 | buff_pos += BATMAN_OGM_HLEN + |
1182 | tt_len(batman_ogm_packet->tt_num_changes); | 1182 | tt_len(batman_ogm_packet->tt_num_changes); |
1183 | 1183 | ||
1184 | batman_ogm_packet = (struct batman_ogm_packet *) | 1184 | batman_ogm_packet = (struct batman_ogm_packet *) |
diff --git a/net/batman-adv/packet.h b/net/batman-adv/packet.h index 59800e82371a..59dec0a1979b 100644 --- a/net/batman-adv/packet.h +++ b/net/batman-adv/packet.h | |||
@@ -126,7 +126,7 @@ struct batman_ogm_packet { | |||
126 | uint16_t tt_crc; | 126 | uint16_t tt_crc; |
127 | } __packed; | 127 | } __packed; |
128 | 128 | ||
129 | #define BATMAN_OGM_LEN sizeof(struct batman_ogm_packet) | 129 | #define BATMAN_OGM_HLEN sizeof(struct batman_ogm_packet) |
130 | 130 | ||
131 | struct icmp_packet { | 131 | struct icmp_packet { |
132 | struct batman_header header; | 132 | struct batman_header header; |
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 78eddc9067e6..ac13a6a7409d 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -254,7 +254,7 @@ int recv_bat_ogm_packet(struct sk_buff *skb, struct hard_iface *hard_iface) | |||
254 | struct ethhdr *ethhdr; | 254 | struct ethhdr *ethhdr; |
255 | 255 | ||
256 | /* drop packet if it has not necessary minimum size */ | 256 | /* drop packet if it has not necessary minimum size */ |
257 | if (unlikely(!pskb_may_pull(skb, BATMAN_OGM_LEN))) | 257 | if (unlikely(!pskb_may_pull(skb, BATMAN_OGM_HLEN))) |
258 | return NET_RX_DROP; | 258 | return NET_RX_DROP; |
259 | 259 | ||
260 | ethhdr = (struct ethhdr *)skb_mac_header(skb); | 260 | ethhdr = (struct ethhdr *)skb_mac_header(skb); |
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c index af7a6741a685..b5f078cacc09 100644 --- a/net/batman-adv/send.c +++ b/net/batman-adv/send.c | |||
@@ -87,7 +87,7 @@ static void realloc_packet_buffer(struct hard_iface *hard_iface, | |||
87 | /* keep old buffer if kmalloc should fail */ | 87 | /* keep old buffer if kmalloc should fail */ |
88 | if (new_buff) { | 88 | if (new_buff) { |
89 | memcpy(new_buff, hard_iface->packet_buff, | 89 | memcpy(new_buff, hard_iface->packet_buff, |
90 | BATMAN_OGM_LEN); | 90 | BATMAN_OGM_HLEN); |
91 | 91 | ||
92 | kfree(hard_iface->packet_buff); | 92 | kfree(hard_iface->packet_buff); |
93 | hard_iface->packet_buff = new_buff; | 93 | hard_iface->packet_buff = new_buff; |
@@ -101,13 +101,13 @@ static int prepare_packet_buffer(struct bat_priv *bat_priv, | |||
101 | { | 101 | { |
102 | int new_len; | 102 | int new_len; |
103 | 103 | ||
104 | new_len = BATMAN_OGM_LEN + | 104 | new_len = BATMAN_OGM_HLEN + |
105 | tt_len((uint8_t)atomic_read(&bat_priv->tt_local_changes)); | 105 | tt_len((uint8_t)atomic_read(&bat_priv->tt_local_changes)); |
106 | 106 | ||
107 | /* if we have too many changes for one packet don't send any | 107 | /* if we have too many changes for one packet don't send any |
108 | * and wait for the tt table request which will be fragmented */ | 108 | * and wait for the tt table request which will be fragmented */ |
109 | if (new_len > hard_iface->soft_iface->mtu) | 109 | if (new_len > hard_iface->soft_iface->mtu) |
110 | new_len = BATMAN_OGM_LEN; | 110 | new_len = BATMAN_OGM_HLEN; |
111 | 111 | ||
112 | realloc_packet_buffer(hard_iface, new_len); | 112 | realloc_packet_buffer(hard_iface, new_len); |
113 | 113 | ||
@@ -117,14 +117,14 @@ static int prepare_packet_buffer(struct bat_priv *bat_priv, | |||
117 | atomic_set(&bat_priv->tt_ogm_append_cnt, TT_OGM_APPEND_MAX); | 117 | atomic_set(&bat_priv->tt_ogm_append_cnt, TT_OGM_APPEND_MAX); |
118 | 118 | ||
119 | return tt_changes_fill_buffer(bat_priv, | 119 | return tt_changes_fill_buffer(bat_priv, |
120 | hard_iface->packet_buff + BATMAN_OGM_LEN, | 120 | hard_iface->packet_buff + BATMAN_OGM_HLEN, |
121 | hard_iface->packet_len - BATMAN_OGM_LEN); | 121 | hard_iface->packet_len - BATMAN_OGM_HLEN); |
122 | } | 122 | } |
123 | 123 | ||
124 | static int reset_packet_buffer(struct bat_priv *bat_priv, | 124 | static int reset_packet_buffer(struct bat_priv *bat_priv, |
125 | struct hard_iface *hard_iface) | 125 | struct hard_iface *hard_iface) |
126 | { | 126 | { |
127 | realloc_packet_buffer(hard_iface, BATMAN_OGM_LEN); | 127 | realloc_packet_buffer(hard_iface, BATMAN_OGM_HLEN); |
128 | return 0; | 128 | return 0; |
129 | } | 129 | } |
130 | 130 | ||