From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Marek Lindner Date: Wed, 24 Apr 2013 03:58:56 +0800 References: <1366727676-23233-1-git-send-email-ordex@autistici.org> <1366727676-23233-3-git-send-email-ordex@autistici.org> In-Reply-To: <1366727676-23233-3-git-send-email-ordex@autistici.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201304240358.56353.lindner_marek@yahoo.de> Subject: Re: [B.A.T.M.A.N.] [PATCH 2/7] batman-adv: use vid when computing local and global TT CRC Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: The list for a Better Approach To Mobile Ad-hoc Networking On Tuesday, April 23, 2013 22:34:30 Antonio Quartulli wrote: > @@ -1535,7 +1535,9 @@ static uint32_t batadv_tt_global_crc(struct > batadv_priv *bat_priv, orig_node)) continue; > > - crc ^= crc32c(0, tt_common->addr, ETH_ALEN); > + crc_tmp = crc32c(0, &tt_common->vid, > + sizeof(tt_common->vid)); > + crc ^= crc32c(crc_tmp, tt_common->addr, ETH_ALEN); > } > rcu_read_unlock(); Is it necessary to define another variable ? Why not: crc = crc32c(0, &tt_common->vid, sizeof(tt_common->vid)); crc ^= crc32c(crc, tt_common->addr, ETH_ALEN); > @@ -1565,7 +1567,9 @@ static uint32_t batadv_tt_local_crc(struct batadv_priv *bat_priv) > if (tt_common->flags & BATADV_TT_CLIENT_NEW) > continue; > > - crc ^= crc32c(0, tt_common->addr, ETH_ALEN); > + crc_tmp = crc32c(0, &tt_common->vid, > + sizeof(tt_common->vid)); > + crc ^= crc32c(crc_tmp, tt_common->addr, ETH_ALEN); > } Dito. Cheers, Marek