From patchwork Fri Sep 15 04:34:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikunj A Dadhania X-Patchwork-Id: 814045 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xtjHY3FMyz9t2f for ; Fri, 15 Sep 2017 14:35:05 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xtjHX4f9zzDrXc for ; Fri, 15 Sep 2017 14:35:04 +1000 (AEST) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=nikunj@linux.vnet.ibm.com; receiver=) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xtjHT09WVzDrX5 for ; Fri, 15 Sep 2017 14:35:00 +1000 (AEST) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8F4Yhgv040937 for ; Fri, 15 Sep 2017 00:34:58 -0400 Received: from e23smtp03.au.ibm.com (e23smtp03.au.ibm.com [202.81.31.145]) by mx0a-001b2d01.pphosted.com with ESMTP id 2d0388jpnj-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 15 Sep 2017 00:34:58 -0400 Received: from localhost by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 15 Sep 2017 14:34:56 +1000 Received: from d23relay10.au.ibm.com (202.81.31.229) by e23smtp03.au.ibm.com (202.81.31.209) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 15 Sep 2017 14:34:53 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v8F4YrkM42074358 for ; Fri, 15 Sep 2017 14:34:53 +1000 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v8F4Yjcn003467 for ; Fri, 15 Sep 2017 14:34:45 +1000 Received: from abhimanyu.ibmmodules.com ([9.85.80.220]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v8F4YgxW003408; Fri, 15 Sep 2017 14:34:44 +1000 From: Nikunj A Dadhania To: slof@lists.ozlabs.org Date: Fri, 15 Sep 2017 10:04:36 +0530 X-Mailer: git-send-email 2.9.3 X-TM-AS-MML: disable x-cbid: 17091504-0008-0000-0000-0000015807F4 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17091504-0009-0000-0000-0000098D0E6A Message-Id: <20170915043436.31252-1-nikunj@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-09-15_01:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709150067 Subject: [SLOF] [PATCH] libnet/ipv6: assign times_asked value directly X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" 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 Reviewed-by: Thomas Huth --- 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); }