Give carp(4) interfaces their own low priority. The change should not
authorclaudio <claudio@openbsd.org>
Fri, 15 May 2015 11:53:06 +0000 (11:53 +0000)
committerclaudio <claudio@openbsd.org>
Fri, 15 May 2015 11:53:06 +0000 (11:53 +0000)
change behaviour for now but will allow to share the same address with
the parent interface without major hacks.
OK mpi@

sys/net/if_var.h
sys/netinet/ip_carp.c

index a226f62..78e7b57 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: if_var.h,v 1.26 2015/05/15 10:15:13 mpi Exp $ */
+/*     $OpenBSD: if_var.h,v 1.27 2015/05/15 11:53:06 claudio Exp $     */
 /*     $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $  */
 
 /*
@@ -389,6 +389,7 @@ do {                                                                        \
 /* default interface priorities */
 #define IF_WIRED_DEFAULT_PRIORITY      0
 #define IF_WIRELESS_DEFAULT_PRIORITY   4
+#define IF_CARP_DEFAULT_PRIORITY       15
 
 /*
  * Network stack input queues.
index 8460aa6..76185eb 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ip_carp.c,v 1.255 2015/05/15 10:09:23 mpi Exp $       */
+/*     $OpenBSD: ip_carp.c,v 1.256 2015/05/15 11:53:06 claudio Exp $   */
 
 /*
  * Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -752,6 +752,7 @@ carp_clone_create(ifc, unit)
        ifp->if_type = IFT_CARP;
        ifp->if_sadl->sdl_type = IFT_CARP;
        ifp->if_output = carp_output;
+       ifp->if_priority = IF_CARP_DEFAULT_PRIORITY;
 
        /* Hook carp_addr_updated to cope with address and route changes. */
        sc->ah_cookie = hook_establish(sc->sc_if.if_addrhooks, 0,