diff options
-rw-r--r-- | net/batman-adv/bridge_loop_avoidance.c | 8 | ||||
-rw-r--r-- | net/batman-adv/routing.c | 8 |
2 files changed, 11 insertions, 5 deletions
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c index 0a9084ad19a6..eebab20c7478 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c | |||
@@ -1210,8 +1210,8 @@ int batadv_bla_init(struct batadv_priv *bat_priv) | |||
1210 | /** | 1210 | /** |
1211 | * batadv_bla_check_bcast_duplist | 1211 | * batadv_bla_check_bcast_duplist |
1212 | * @bat_priv: the bat priv with all the soft interface information | 1212 | * @bat_priv: the bat priv with all the soft interface information |
1213 | * @bcast_packet: originator mac address | 1213 | * @bcast_packet: encapsulated broadcast frame plus batman header |
1214 | * @hdr_size: maximum length of the frame | 1214 | * @bcast_packet_len: length of encapsulated broadcast frame plus batman header |
1215 | * | 1215 | * |
1216 | * check if it is on our broadcast list. Another gateway might | 1216 | * check if it is on our broadcast list. Another gateway might |
1217 | * have sent the same packet because it is connected to the same backbone, | 1217 | * have sent the same packet because it is connected to the same backbone, |
@@ -1224,14 +1224,14 @@ int batadv_bla_init(struct batadv_priv *bat_priv) | |||
1224 | */ | 1224 | */ |
1225 | int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv, | 1225 | int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv, |
1226 | struct batadv_bcast_packet *bcast_packet, | 1226 | struct batadv_bcast_packet *bcast_packet, |
1227 | int hdr_size) | 1227 | int bcast_packet_len) |
1228 | { | 1228 | { |
1229 | int i, length, curr; | 1229 | int i, length, curr; |
1230 | uint8_t *content; | 1230 | uint8_t *content; |
1231 | uint16_t crc; | 1231 | uint16_t crc; |
1232 | struct batadv_bcast_duplist_entry *entry; | 1232 | struct batadv_bcast_duplist_entry *entry; |
1233 | 1233 | ||
1234 | length = hdr_size - sizeof(*bcast_packet); | 1234 | length = bcast_packet_len - sizeof(*bcast_packet); |
1235 | content = (uint8_t *)bcast_packet; | 1235 | content = (uint8_t *)bcast_packet; |
1236 | content += sizeof(*bcast_packet); | 1236 | content += sizeof(*bcast_packet); |
1237 | 1237 | ||
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 939fc01371df..376b4cc6ca82 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -1124,8 +1124,14 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, | |||
1124 | 1124 | ||
1125 | spin_unlock_bh(&orig_node->bcast_seqno_lock); | 1125 | spin_unlock_bh(&orig_node->bcast_seqno_lock); |
1126 | 1126 | ||
1127 | /* keep skb linear for crc calculation */ | ||
1128 | if (skb_linearize(skb) < 0) | ||
1129 | goto out; | ||
1130 | |||
1131 | bcast_packet = (struct batadv_bcast_packet *)skb->data; | ||
1132 | |||
1127 | /* check whether this has been sent by another originator before */ | 1133 | /* check whether this has been sent by another originator before */ |
1128 | if (batadv_bla_check_bcast_duplist(bat_priv, bcast_packet, hdr_size)) | 1134 | if (batadv_bla_check_bcast_duplist(bat_priv, bcast_packet, skb->len)) |
1129 | goto out; | 1135 | goto out; |
1130 | 1136 | ||
1131 | /* rebroadcast packet */ | 1137 | /* rebroadcast packet */ |