Commit ca663046 authored by Antonio Quartulli's avatar Antonio Quartulli

batman-adv: fix alignment for batadv_tvlv_tt_change

Make struct batadv_tvlv_tt_change a multiple 4 bytes long
to avoid padding on any architecture.
Signed-off-by: default avatarAntonio Quartulli <antonio@meshcoding.com>
Signed-off-by: default avatarMarek Lindner <mareklindner@neomailbox.ch>
parent 2f7a3182
...@@ -484,13 +484,13 @@ struct batadv_tvlv_tt_vlan_data { ...@@ -484,13 +484,13 @@ struct batadv_tvlv_tt_vlan_data {
* struct batadv_tvlv_tt_change - translation table diff data * struct batadv_tvlv_tt_change - translation table diff data
* @flags: status indicators concerning the non-mesh client (see * @flags: status indicators concerning the non-mesh client (see
* batadv_tt_client_flags) * batadv_tt_client_flags)
* @reserved: reserved field * @reserved: reserved field - useful for alignment purposes only
* @addr: mac address of non-mesh client that triggered this tt change * @addr: mac address of non-mesh client that triggered this tt change
* @vid: VLAN identifier * @vid: VLAN identifier
*/ */
struct batadv_tvlv_tt_change { struct batadv_tvlv_tt_change {
uint8_t flags; uint8_t flags;
uint8_t reserved; uint8_t reserved[3];
uint8_t addr[ETH_ALEN]; uint8_t addr[ETH_ALEN];
__be16 vid; __be16 vid;
}; };
......
...@@ -333,7 +333,8 @@ static void batadv_tt_local_event(struct batadv_priv *bat_priv, ...@@ -333,7 +333,8 @@ static void batadv_tt_local_event(struct batadv_priv *bat_priv,
return; return;
tt_change_node->change.flags = flags; tt_change_node->change.flags = flags;
tt_change_node->change.reserved = 0; memset(tt_change_node->change.reserved, 0,
sizeof(tt_change_node->change.reserved));
memcpy(tt_change_node->change.addr, common->addr, ETH_ALEN); memcpy(tt_change_node->change.addr, common->addr, ETH_ALEN);
tt_change_node->change.vid = htons(common->vid); tt_change_node->change.vid = htons(common->vid);
...@@ -2221,7 +2222,8 @@ static void batadv_tt_tvlv_generate(struct batadv_priv *bat_priv, ...@@ -2221,7 +2222,8 @@ static void batadv_tt_tvlv_generate(struct batadv_priv *bat_priv,
ETH_ALEN); ETH_ALEN);
tt_change->flags = tt_common_entry->flags; tt_change->flags = tt_common_entry->flags;
tt_change->vid = htons(tt_common_entry->vid); tt_change->vid = htons(tt_common_entry->vid);
tt_change->reserved = 0; memset(tt_change->reserved, 0,
sizeof(tt_change->reserved));
tt_num_entries++; tt_num_entries++;
tt_change++; tt_change++;
......
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