On Thu, May 23, 2013 at 01:07:42PM +0200, Simon Wunderlich wrote:
Changes to PATCHv1:
- use enum to distinguish different duplicate states
- fix typo "is_simlar -> is_similar"
- remove antonios sign off (the patch changed, feel free to add it if he is ok with it, it was his idea originally ...)
no, it's ok as it is :)
bat_iv_ogm.c | 86 +++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 55 insertions(+), 31 deletions(-)
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c index 8d87f87..2b94fdd 100644 --- a/bat_iv_ogm.c +++ b/bat_iv_ogm.c @@ -701,6 +701,21 @@ static void batadv_iv_ogm_schedule(struct batadv_hard_iface *hard_iface) batadv_hardif_free_ref(primary_if); }
+/**
- batadv_dup_status - duplicate status
- @BATADV_NO_DUP: the packet is a duplicate
- @BATADV_ORIG_DUP: OGM is a duplicate in the originator (but not for the
- neighbor)
- @BATADV_NEIGH_DUP: OGM is a duplicate for the neighbor
- @BATADV_PROTECTED: originator is currently protected (after reboot)
- */
+enum batadv_dup_status {
- BATADV_NO_DUP = 0,
- BATADV_ORIG_DUP,
- BATADV_NEIGH_DUP,
- BATADV_PROTECTED,
+};
Very nice! splitting the "simple boolean" into an enum is a very good idea imho.
-/* processes a batman packet for all interfaces, adjusts the sequence number and
- finds out whether it is a duplicate.
+/**
- batadv_iv_ogm_update_seqnos - processes a batman packet for all interfaces,
- adjusts the sequence number and finds out whether it is a duplicate.
- @ethhdr: Ethernet header of the packet
- @batadv_ogm_packet: OGM packet to be considered
- @if_incoming: interface where the OGM packet was received
A blank line is needed here. Maybe who's going to merge this patch can add it? :)
- Returns: duplicate status as enum batadv_dup_status
- returns:
- 1 the packet is a duplicate
- 0 the packet has not yet been received
- -1 the packet is old and has been received while the seqno window
was protected. Caller should drop it.
- */
-static int
- */
+enum batadv_dup_status batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr, const struct batadv_ogm_packet *batadv_ogm_packet, const struct batadv_hard_iface *if_incoming)
The rest looks good! Thanks Simon.
Cheers,