summaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
authormvs <mvs@cvs.openbsd.org>2020-07-24 18:17:16 +0000
committermvs <mvs@cvs.openbsd.org>2020-07-24 18:17:16 +0000
commit4d197a94287f7314327ee06ffb48d36fdf9b74b2 (patch)
tree17903fcf8ca2d1b8856ee6e38ba4e3778dd56f83 /sys/net/if.c
parentf17d71dd0ed4d38d10059f6942259e3de2764ca0 (diff)
Use interface index instead of pointer to `ifnet' in carp(4).
ok sashan@
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 51ec987c37d..a38bd144869 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.615 2020/07/22 02:16:01 dlg Exp $ */
+/* $OpenBSD: if.c,v 1.616 2020/07/24 18:17:14 mvs Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -1125,8 +1125,9 @@ if_isconnected(const struct ifnet *ifp0, unsigned int ifidx)
connected = 1;
#endif
#if NCARP > 0
- if ((ifp0->if_type == IFT_CARP && ifp0->if_carpdev == ifp) ||
- (ifp->if_type == IFT_CARP && ifp->if_carpdev == ifp0))
+ if ((ifp0->if_type == IFT_CARP &&
+ ifp0->if_carpdevidx == ifp->if_index) ||
+ (ifp->if_type == IFT_CARP && ifp->if_carpdevidx == ifp0->if_index))
connected = 1;
#endif