From: Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
To: The list for a Better Approach To Mobile Ad-hoc Networking
<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCHv2 2/9] batman-adv: make struct batadv_orig_node algorithm agnostic
Date: Mon, 12 Aug 2013 16:28:12 +0200 [thread overview]
Message-ID: <20130812142812.GA18832@pandem0nium> (raw)
In-Reply-To: <1376224403-2494-3-git-send-email-ordex@autistici.org>
[-- Attachment #1: Type: text/plain, Size: 1611 bytes --]
> diff --git a/routing.c b/routing.c
> index d4f512d..5b8f087 100644
> --- a/routing.c
> +++ b/routing.c
> @@ -1091,6 +1091,7 @@ int batadv_recv_bcast_packet(struct sk_buff *skb,
> int hdr_size = sizeof(*bcast_packet);
> int ret = NET_RX_DROP;
> int32_t seq_diff;
> + uint32_t seqno;
>
> /* drop packet if it has not necessary minimum size */
> if (unlikely(!pskb_may_pull(skb, hdr_size)))
> @@ -1126,12 +1127,13 @@ int batadv_recv_bcast_packet(struct sk_buff *skb,
>
> spin_lock_bh(&orig_node->bcast_seqno_lock);
>
> + seqno = ntohl(bcast_packet->seqno);
> /* check whether the packet is a duplicate */
> if (batadv_test_bit(orig_node->bcast_bits, orig_node->last_bcast_seqno,
> - ntohl(bcast_packet->seqno)))
> + seqno))
> goto spin_unlock;
>
> - seq_diff = ntohl(bcast_packet->seqno) - orig_node->last_bcast_seqno;
> + seq_diff = seqno - orig_node->last_bcast_seqno;
>
> /* check whether the packet is old and the host just restarted. */
> if (batadv_window_protected(bat_priv, seq_diff,
> @@ -1142,7 +1144,7 @@ int batadv_recv_bcast_packet(struct sk_buff *skb,
> * if required.
> */
> if (batadv_bit_get_packet(bat_priv, orig_node->bcast_bits, seq_diff, 1))
> - orig_node->last_bcast_seqno = ntohl(bcast_packet->seqno);
> + orig_node->last_bcast_seqno = seqno;
>
> spin_unlock_bh(&orig_node->bcast_seqno_lock);
Why are you changing this seqno stuff? Although this might be a valid
(micro-)optimization, I don't think this should be in this patch ... or
at least I don't understand it. :)
Cheers,
Simon
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2013-08-12 14:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-11 12:33 [B.A.T.M.A.N.] [PATCHv2 0/9] Improving the routing protocol abstraction Antonio Quartulli
2013-08-11 12:33 ` [B.A.T.M.A.N.] [PATCHv2 1/9] batman-adv: make struct batadv_neigh_node algorithm agnostic Antonio Quartulli
2013-08-11 12:33 ` [B.A.T.M.A.N.] [PATCHv2 2/9] batman-adv: make struct batadv_orig_node " Antonio Quartulli
2013-08-12 14:28 ` Simon Wunderlich [this message]
2013-08-12 17:48 ` Antonio Quartulli
2013-08-11 12:33 ` [B.A.T.M.A.N.] [PATCHv2 3/9] batman-adv: add bat_orig_print function API Antonio Quartulli
2013-08-11 12:33 ` [B.A.T.M.A.N.] [PATCHv2 4/9] batman-adv: add bat_metric_get API function Antonio Quartulli
2013-08-11 12:33 ` [B.A.T.M.A.N.] [PATCHv2 5/9] batman-adv: add bat_metric_is_equiv_or_better " Antonio Quartulli
2013-08-11 12:33 ` [B.A.T.M.A.N.] [PATCHv2 6/9] batman-adv: adapt bonding to use the new API functions Antonio Quartulli
2013-08-11 12:33 ` [B.A.T.M.A.N.] [PATCHv2 7/9] batman-adv: adapt the neighbor purging routine " Antonio Quartulli
2013-08-12 14:31 ` Simon Wunderlich
2013-08-12 17:51 ` Antonio Quartulli
2013-08-12 21:25 ` Antonio Quartulli
2013-08-13 6:08 ` Simon Wunderlich
2013-08-11 12:33 ` [B.A.T.M.A.N.] [PATCHv2 8/9] batman-adv: provide orig_node routing API Antonio Quartulli
2013-08-11 12:33 ` [B.A.T.M.A.N.] [PATCHv2 9/9] batman-adv: adapt the TT component to use the new API functions Antonio Quartulli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130812142812.GA18832@pandem0nium \
--to=simon.wunderlich@s2003.tu-chemnitz.de \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox