diff mbox series

libnet/ipv6: assign times_asked value directly

Message ID 20170915043436.31252-1-nikunj@linux.vnet.ibm.com
State Accepted
Headers show
Series libnet/ipv6: assign times_asked value directly | expand

Commit Message

Nikunj A Dadhania Sept. 15, 2017, 4:34 a.m. UTC
times_asked value remains same as the structure is zeroed, but it makes more
sense to do that directly instead of adding with previous value.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
---
 lib/libnet/ipv6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thomas Huth Sept. 15, 2017, 4:43 a.m. UTC | #1
On 15.09.2017 06:34, Nikunj A Dadhania wrote:
> times_asked value remains same as the structure is zeroed, but it makes more
> sense to do that directly instead of adding with previous value.
> 
> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
> ---
>  lib/libnet/ipv6.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/libnet/ipv6.c b/lib/libnet/ipv6.c
> index 62a444e..6c6fb54 100644
> --- a/lib/libnet/ipv6.c
> +++ b/lib/libnet/ipv6.c
> @@ -543,7 +543,7 @@ int send_ipv6(int fd, void* buffer, int len)
>  			memset(n, 0, sizeof(struct neighbor));
>  			memcpy(&(n->ip.addr[0]), &ip_dst, 16);
>  			n->status = NB_PROBE;
> -			n->times_asked += 1;
> +			n->times_asked = 1;
>  			neighbor_add(n);
>  		}

Reviewed-by: Thomas Huth <thuth@redhat.com>
Alexey Kardashevskiy Sept. 26, 2017, 3:10 a.m. UTC | #2
On 15/09/17 14:34, Nikunj A Dadhania wrote:
> times_asked value remains same as the structure is zeroed, but it makes more
> sense to do that directly instead of adding with previous value.
> 
> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>



Thanks, applied.


> ---
>  lib/libnet/ipv6.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/libnet/ipv6.c b/lib/libnet/ipv6.c
> index 62a444e..6c6fb54 100644
> --- a/lib/libnet/ipv6.c
> +++ b/lib/libnet/ipv6.c
> @@ -543,7 +543,7 @@ int send_ipv6(int fd, void* buffer, int len)
>  			memset(n, 0, sizeof(struct neighbor));
>  			memcpy(&(n->ip.addr[0]), &ip_dst, 16);
>  			n->status = NB_PROBE;
> -			n->times_asked += 1;
> +			n->times_asked = 1;
>  			neighbor_add(n);
>  		}
>  
>
diff mbox series

Patch

diff --git a/lib/libnet/ipv6.c b/lib/libnet/ipv6.c
index 62a444e..6c6fb54 100644
--- a/lib/libnet/ipv6.c
+++ b/lib/libnet/ipv6.c
@@ -543,7 +543,7 @@  int send_ipv6(int fd, void* buffer, int len)
 			memset(n, 0, sizeof(struct neighbor));
 			memcpy(&(n->ip.addr[0]), &ip_dst, 16);
 			n->status = NB_PROBE;
-			n->times_asked += 1;
+			n->times_asked = 1;
 			neighbor_add(n);
 		}