Make sure we initialize all structs to 0; from Xin LI
This commit is contained in:
parent
b7d86f5e4c
commit
1482d7ce1c
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_bridge.c,v 1.34 2005/12/24 20:45:09 perry Exp $ */
|
||||
/* $NetBSD: if_bridge.c,v 1.35 2006/01/09 13:04:38 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2001 Wasabi Systems, Inc.
|
||||
|
@ -80,7 +80,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.34 2005/12/24 20:45:09 perry Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.35 2006/01/09 13:04:38 christos Exp $");
|
||||
|
||||
#include "opt_bridge_ipf.h"
|
||||
#include "opt_inet.h"
|
||||
|
@ -489,6 +489,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
|||
break;
|
||||
}
|
||||
|
||||
memset(&args, 0, sizeof(args));
|
||||
if (bc->bc_flags & BC_F_COPYIN) {
|
||||
error = copyin(ifd->ifd_data, &args, ifd->ifd_len);
|
||||
if (error)
|
||||
|
@ -812,6 +813,7 @@ bridge_ioctl_rts(struct bridge_softc *sc, void *arg)
|
|||
LIST_FOREACH(brt, &sc->sc_rtlist, brt_list) {
|
||||
if (len < sizeof(bareq))
|
||||
goto out;
|
||||
memset(&bareq, 0, sizeof(bareq));
|
||||
strlcpy(bareq.ifba_ifsname, brt->brt_ifp->if_xname,
|
||||
sizeof(bareq.ifba_ifsname));
|
||||
memcpy(bareq.ifba_dst, brt->brt_addr, sizeof(brt->brt_addr));
|
||||
|
|
Loading…
Reference in New Issue