aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/send.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/batman-adv/send.c')
-rw-r--r--net/batman-adv/send.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
index af7a6741a685..7c66b6121fa6 100644
--- a/net/batman-adv/send.c
+++ b/net/batman-adv/send.c
@@ -51,7 +51,7 @@ int send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface,
51 } 51 }
52 52
53 /* push to the ethernet header. */ 53 /* push to the ethernet header. */
54 if (my_skb_head_push(skb, sizeof(*ethhdr)) < 0) 54 if (my_skb_head_push(skb, ETH_HLEN) < 0)
55 goto send_skb_err; 55 goto send_skb_err;
56 56
57 skb_reset_mac_header(skb); 57 skb_reset_mac_header(skb);
@@ -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
124static int reset_packet_buffer(struct bat_priv *bat_priv, 124static 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