summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_carp.c
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2006-03-23 14:18:56 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2006-03-23 14:18:56 +0000
commit6f1e2c607ff6277406d6b2e14c0edc78a3e00c13 (patch)
treecef344e7e10128eb8333f28744485055ccbf180d /sys/netinet/ip_carp.c
parent94b87dfdbb508e9fb72ea6f01ac25ad77ee5237e (diff)
Set a carp MAC address of 00:00:00:00:00:00 if no vhid is assigned.
ok henning@
Diffstat (limited to 'sys/netinet/ip_carp.c')
-rw-r--r--sys/netinet/ip_carp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 57752a846bf..11bad1f38f6 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.c,v 1.120 2006/03/22 14:37:44 henning Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.121 2006/03/23 14:18:55 mcbride Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -1535,7 +1535,9 @@ carp_set_ifp(struct carp_softc *sc, struct ifnet *ifp)
void
carp_set_enaddr(struct carp_softc *sc)
{
- if (sc->sc_carpdev && sc->sc_carpdev->if_type == IFT_ISO88025) {
+ if (sc->sc_vhid == -1) {
+ bzero(&sc->sc_ac.ac_enaddr, sizeof (sc->sc_ac.ac_enaddr));
+ } else if (sc->sc_carpdev && sc->sc_carpdev->if_type == IFT_ISO88025) {
sc->sc_ac.ac_enaddr[0] = 3;
sc->sc_ac.ac_enaddr[1] = 0;
sc->sc_ac.ac_enaddr[2] = 0x40 >> (sc->sc_vhid - 1);