In the NewMedia callback, make sure we have a LAN Node ID tuple.

This commit is contained in:
thorpej 1998-08-15 06:56:12 +00:00
parent 2be6d344ab
commit d5b735ae79
1 changed files with 9 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_sm_pcmcia.c,v 1.8 1998/08/15 06:46:33 thorpej Exp $ */
/* $NetBSD: if_sm_pcmcia.c,v 1.9 1998/08/15 06:56:12 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -293,8 +293,15 @@ sm_pcmcia_newmedia_ciscallback(tuple, arg)
int i;
if (tuple->code == PCMCIA_CISTPL_FUNCE) {
if (tuple->length < ETHER_ADDR_LEN)
/* subcode, length */
if (tuple->length < 2)
return (0);
if ((pcmcia_tuple_read_1(tuple, 0) !=
PCMCIA_TPLFE_TYPE_LAN_NID) ||
(pcmcia_tuple_read_1(tuple, 1) != ETHER_ADDR_LEN))
return (0);
for (i = 0; i < ETHER_ADDR_LEN; i++)
myla[i] = pcmcia_tuple_read_1(tuple, i + 2);
return (1);