ar_tha() can return NULL; treat this as an error.
This commit is contained in:
parent
6b6eea3c51
commit
dd8534acfe
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_arcsubr.c,v 1.60 2008/11/07 00:20:13 dyoung Exp $ */
|
||||
/* $NetBSD: if_arcsubr.c,v 1.61 2009/11/20 02:14:56 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Ignatios Souvatzis
|
||||
|
@ -35,7 +35,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_arcsubr.c,v 1.60 2008/11/07 00:20:13 dyoung Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_arcsubr.c,v 1.61 2009/11/20 02:14:56 christos Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
|
@ -197,8 +197,12 @@ arc_output(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst,
|
|||
arph = mtod(m, struct arphdr *);
|
||||
if (m->m_flags & M_BCAST)
|
||||
adst = arcbroadcastaddr;
|
||||
else
|
||||
adst = *ar_tha(arph);
|
||||
else {
|
||||
uint8_t *tha = ar_tha(arph);
|
||||
if (tha == NULL)
|
||||
return 0;
|
||||
adst = *tha;
|
||||
}
|
||||
|
||||
arph->ar_hrd = htons(ARPHRD_ARCNET);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_ecosubr.c,v 1.32 2009/03/18 16:00:22 cegger Exp $ */
|
||||
/* $NetBSD: if_ecosubr.c,v 1.33 2009/11/20 02:14:56 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 Ben Harris
|
||||
|
@ -58,7 +58,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ecosubr.c,v 1.32 2009/03/18 16:00:22 cegger Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ecosubr.c,v 1.33 2009/11/20 02:14:56 christos Exp $");
|
||||
|
||||
#include "bpfilter.h"
|
||||
#include "opt_inet.h"
|
||||
|
@ -265,7 +265,8 @@ eco_output(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst,
|
|||
ECO_ADDR_LEN);
|
||||
else {
|
||||
tha = ar_tha(ah);
|
||||
KASSERT(tha != NULL);
|
||||
if (tha == NULL)
|
||||
return 0;
|
||||
memcpy(ehdr.eco_dhost, tha, ECO_ADDR_LEN);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_ethersubr.c,v 1.172 2009/05/29 04:57:04 darran Exp $ */
|
||||
/* $NetBSD: if_ethersubr.c,v 1.173 2009/11/20 02:14:56 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
|
@ -61,7 +61,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.172 2009/05/29 04:57:04 darran Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.173 2009/11/20 02:14:56 christos Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_atalk.h"
|
||||
|
@ -301,7 +301,10 @@ ether_output(struct ifnet *ifp0, struct mbuf *m0, const struct sockaddr *dst,
|
|||
else {
|
||||
void *tha = ar_tha(ah);
|
||||
|
||||
KASSERT(tha);
|
||||
if (tha == NULL) {
|
||||
/* fake with ARPHDR_IEEE1394 */
|
||||
return 0;
|
||||
}
|
||||
memcpy(edst, tha, sizeof(edst));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_fddisubr.c,v 1.77 2008/11/07 00:20:13 dyoung Exp $ */
|
||||
/* $NetBSD: if_fddisubr.c,v 1.78 2009/11/20 02:14:56 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
|
@ -96,7 +96,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_fddisubr.c,v 1.77 2008/11/07 00:20:13 dyoung Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_fddisubr.c,v 1.78 2009/11/20 02:14:56 christos Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_atalk.h"
|
||||
|
@ -306,8 +306,8 @@ fddi_output(struct ifnet *ifp0, struct mbuf *m0, const struct sockaddr *dst,
|
|||
memcpy(edst, etherbroadcastaddr, sizeof(edst));
|
||||
else {
|
||||
void *tha = ar_tha(ah);
|
||||
|
||||
KASSERT(tha);
|
||||
if (tha == NULL)
|
||||
return 0;
|
||||
memcpy(edst, tha, sizeof(edst));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_tokensubr.c,v 1.57 2009/04/18 14:58:05 tsutsui Exp $ */
|
||||
/* $NetBSD: if_tokensubr.c,v 1.58 2009/11/20 02:14:57 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1989, 1993
|
||||
|
@ -92,7 +92,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_tokensubr.c,v 1.57 2009/04/18 14:58:05 tsutsui Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_tokensubr.c,v 1.58 2009/11/20 02:14:57 christos Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_atalk.h"
|
||||
|
@ -308,10 +308,10 @@ token_output(struct ifnet *ifp0, struct mbuf *m0, const struct sockaddr *dst,
|
|||
memcpy(edst, tokenbroadcastaddr, sizeof(edst));
|
||||
}
|
||||
else {
|
||||
void *tha = (void *)ar_tha(ah);
|
||||
KASSERT(tha);
|
||||
if (tha)
|
||||
memcpy((void *)edst, tha, sizeof(edst));
|
||||
void *tha = ar_tha(ah);
|
||||
if (tha == NULL)
|
||||
return 0;
|
||||
memcpy(edst, tha, sizeof(edst));
|
||||
trh = (struct token_header *)M_TRHSTART(m);
|
||||
trh->token_ac = TOKEN_AC;
|
||||
trh->token_fc = TOKEN_FC;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_arp.c,v 1.148 2009/11/03 00:57:42 christos Exp $ */
|
||||
/* $NetBSD: if_arp.c,v 1.149 2009/11/20 02:14:57 christos 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.148 2009/11/03 00:57:42 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.149 2009/11/20 02:14:57 christos Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_inet.h"
|
||||
|
@ -1403,7 +1403,8 @@ in_revarpinput(struct mbuf *m)
|
|||
if (myip_initialized)
|
||||
goto wake;
|
||||
tha = ar_tha(ah);
|
||||
KASSERT(tha);
|
||||
if (tha == NULL)
|
||||
goto out;
|
||||
if (memcmp(tha, CLLADDR(ifp->if_sadl), ifp->if_sadl->sdl_alen))
|
||||
goto out;
|
||||
memcpy(&srv_ip, ar_spa(ah), sizeof(srv_ip));
|
||||
|
@ -1444,7 +1445,8 @@ revarprequest(struct ifnet *ifp)
|
|||
|
||||
memcpy(ar_sha(ah), CLLADDR(ifp->if_sadl), ah->ar_hln);
|
||||
tha = ar_tha(ah);
|
||||
KASSERT(tha);
|
||||
if (tha == NULL)
|
||||
return;
|
||||
memcpy(tha, CLLADDR(ifp->if_sadl), ah->ar_hln);
|
||||
|
||||
sa.sa_family = AF_ARP;
|
||||
|
|
Loading…
Reference in New Issue