|
@@ -159,7 +159,7 @@ static void send_packet_to_if(struct forw_packet *forw_packet,
|
|
|
"%s %spacket (originator %pM, seqno %d, TQ %d, TTL %d,"
|
|
|
" IDF %s) on interface %s [%s]\n",
|
|
|
fwd_str, (packet_num > 0 ? "aggregated " : ""),
|
|
|
- batman_packet->orig, ntohs(batman_packet->seqno),
|
|
|
+ batman_packet->orig, ntohl(batman_packet->seqno),
|
|
|
batman_packet->tq, batman_packet->ttl,
|
|
|
(batman_packet->flags & DIRECTLINK ?
|
|
|
"on" : "off"),
|
|
@@ -204,7 +204,7 @@ static void send_packet(struct forw_packet *forw_packet)
|
|
|
"%s packet (originator %pM, seqno %d, TTL %d) "
|
|
|
"on interface %s [%s]\n",
|
|
|
(forw_packet->own ? "Sending own" : "Forwarding"),
|
|
|
- batman_packet->orig, ntohs(batman_packet->seqno),
|
|
|
+ batman_packet->orig, ntohl(batman_packet->seqno),
|
|
|
batman_packet->ttl, forw_packet->if_incoming->dev,
|
|
|
forw_packet->if_incoming->addr_str);
|
|
|
|
|
@@ -283,14 +283,14 @@ void schedule_own_packet(struct batman_if *batman_if)
|
|
|
batman_packet = (struct batman_packet *)batman_if->packet_buff;
|
|
|
|
|
|
/* change sequence number to network order */
|
|
|
- batman_packet->seqno = htons((uint16_t)atomic_read(&batman_if->seqno));
|
|
|
+ batman_packet->seqno =
|
|
|
+ htonl((uint32_t)atomic_read(&batman_if->seqno));
|
|
|
|
|
|
if (vis_server == VIS_TYPE_SERVER_SYNC)
|
|
|
batman_packet->flags = VIS_SERVER;
|
|
|
else
|
|
|
batman_packet->flags &= ~VIS_SERVER;
|
|
|
|
|
|
- /* could be read by receive_bat_packet() */
|
|
|
atomic_inc(&batman_if->seqno);
|
|
|
|
|
|
slide_own_bcast_window(batman_if);
|
|
@@ -347,7 +347,7 @@ void schedule_forward_packet(struct orig_node *orig_node,
|
|
|
in_tq, tq_avg, batman_packet->tq, in_ttl - 1,
|
|
|
batman_packet->ttl);
|
|
|
|
|
|
- batman_packet->seqno = htons(batman_packet->seqno);
|
|
|
+ batman_packet->seqno = htonl(batman_packet->seqno);
|
|
|
|
|
|
if (directlink)
|
|
|
batman_packet->flags |= DIRECTLINK;
|
|
@@ -399,6 +399,7 @@ static void _add_bcast_packet_to_list(struct forw_packet *forw_packet,
|
|
|
int add_bcast_packet_to_list(struct sk_buff *skb)
|
|
|
{
|
|
|
struct forw_packet *forw_packet;
|
|
|
+ struct bcast_packet *bcast_packet;
|
|
|
|
|
|
if (!atomic_dec_not_zero(&bcast_queue_left)) {
|
|
|
bat_dbg(DBG_BATMAN, "bcast packet queue full\n");
|
|
@@ -414,6 +415,10 @@ int add_bcast_packet_to_list(struct sk_buff *skb)
|
|
|
if (!skb)
|
|
|
goto packet_free;
|
|
|
|
|
|
+ /* as we have a copy now, it is safe to decrease the TTL */
|
|
|
+ bcast_packet = (struct bcast_packet *)skb->data;
|
|
|
+ bcast_packet->ttl--;
|
|
|
+
|
|
|
skb_reset_mac_header(skb);
|
|
|
|
|
|
forw_packet->skb = skb;
|