Module Name: src Committed By: maxv Date: Fri Jan 20 17:45:42 UTC 2017
Modified Files: src/sys/netinet: if_arp.c Log Message: Reput a nullcheck that was mistakenly removed in rev1.204. ar_hrd is packet-controlled. To generate a diff of this commit: cvs rdiff -u -r1.235 -r1.236 src/sys/netinet/if_arp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/netinet/if_arp.c diff -u src/sys/netinet/if_arp.c:1.235 src/sys/netinet/if_arp.c:1.236 --- src/sys/netinet/if_arp.c:1.235 Mon Jan 16 15:14:16 2017 +++ src/sys/netinet/if_arp.c Fri Jan 20 17:45:42 2017 @@ -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 @@ reply: 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)