summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_carp.c
diff options
context:
space:
mode:
authorMarco Pfatschbacher <mpf@cvs.openbsd.org>2011-09-06 16:00:23 +0000
committerMarco Pfatschbacher <mpf@cvs.openbsd.org>2011-09-06 16:00:23 +0000
commited28873b8fc96feea6ecebe36849b6c04861f387 (patch)
treef50022d482910529247c3d760e949205ebfcc6c8 /sys/netinet/ip_carp.c
parent3368f86d7145ae4fd55fdaf3cb227fbe6b122657 (diff)
Properly initialize struct carp_if (especially vhif_nvrs) with M_ZERO.
This lets carp delete IFF_PROMISC on its carpdev upon destroy. Fix from Stefan Rinkes. OK sthen, bluhm, deraadt.
Diffstat (limited to 'sys/netinet/ip_carp.c')
-rw-r--r--sys/netinet/ip_carp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index ac6be8b7459..56e4ca7f6d6 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.c,v 1.189 2011/07/08 19:07:18 henning Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.190 2011/09/06 16:00:22 mpf Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -1820,7 +1820,7 @@ carp_set_ifp(struct carp_softc *sc, struct ifnet *ifp)
return (EINVAL);
if (ifp->if_carp == NULL) {
- ncif = malloc(sizeof(*cif), M_IFADDR, M_NOWAIT);
+ ncif = malloc(sizeof(*cif), M_IFADDR, M_NOWAIT|M_ZERO);
if (ncif == NULL)
return (ENOBUFS);
if ((error = ifpromisc(ifp, 1))) {