Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet Reput a nullcheck that was mistakenly removed in...



details:   https://anonhg.NetBSD.org/src/rev/6ac72d7573be
branches:  trunk
changeset: 821020:6ac72d7573be
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Jan 20 17:45:42 2017 +0000

description:
Reput a nullcheck that was mistakenly removed in rev1.204. ar_hrd is
packet-controlled.

diffstat:

 sys/netinet/if_arp.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r e0a37a2ab309 -r 6ac72d7573be sys/netinet/if_arp.c
--- a/sys/netinet/if_arp.c      Fri Jan 20 16:54:11 2017 +0000
+++ b/sys/netinet/if_arp.c      Fri Jan 20 17:45:42 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_arp.c,v 1.235 2017/01/16 15:14:16 christos Exp $    */
+/*     $NetBSD: if_arp.c,v 1.236 2017/01/20 17:45:42 maxv Exp $        */
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.235 2017/01/16 15:14:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.236 2017/01/20 17:45:42 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1327,8 +1327,9 @@
                IF_AFDATA_RUNLOCK(ifp);
 
                if ((lle != NULL) && (lle->la_flags & LLE_PUB)) {
-                       (void)memcpy(tha, ar_sha(ah), ah->ar_hln);
-                       (void)memcpy(ar_sha(ah), &lle->ll_addr, ah->ar_hln);
+                       if (tha)
+                               memcpy(tha, ar_sha(ah), ah->ar_hln);
+                       memcpy(ar_sha(ah), &lle->ll_addr, ah->ar_hln);
                        LLE_RUNLOCK(lle);
                } else {
                        if (lle != NULL)



Home | Main Index | Thread Index | Old Index