summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_carp.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2008-05-07 05:14:22 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2008-05-07 05:14:22 +0000
commit65a24792bc9ddbf77a4e57b878d5ef077e00c636 (patch)
tree0c6cf6f9387b3857646bfe438b8fda70d8d0d04f /sys/netinet/ip_carp.c
parentd6464b531ebfbeadcd02daad12fb3e500888ad9a (diff)
Implement routing priorities. Every route inserted has a priority assigned
and the one route with the lowest number wins. This will be used by the routing daemons to resolve the synchronisations issue in case of conflicts. The nasty bits of this are in the multipath code. If no priority is specified the kernel will choose an appropriate priority. Looked at by a few people at n2k8 code is much older
Diffstat (limited to 'sys/netinet/ip_carp.c')
-rw-r--r--sys/netinet/ip_carp.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 72f2b858ff1..293ddc65718 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.c,v 1.163 2008/05/06 15:12:00 mcbride Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.164 2008/05/07 05:14:21 claudio Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -420,11 +420,11 @@ carp_setroute(struct carp_softc *sc, int cmd)
bzero(&info, sizeof(info));
info.rti_info[RTAX_DST] = ifa->ifa_addr;
info.rti_flags = RTF_HOST;
- error = rtrequest1(RTM_DELETE, &info, NULL, 0);
+ error = rtrequest1(RTM_DELETE, &info, RTP_CONNECTED,
+ NULL, 0);
rt_missmsg(RTM_DELETE, &info, info.rti_flags, NULL,
error, 0);
-
/* Check for our address on another interface */
/* XXX cries for proper API */
rnh = rt_gettable(ifa->ifa_addr->sa_family, 0);
@@ -461,7 +461,8 @@ carp_setroute(struct carp_softc *sc, int cmd)
info.rti_info[RTAX_DST] = ifa->ifa_addr;
info.rti_info[RTAX_GATEWAY] = ifa->ifa_addr;
info.rti_flags = RTF_UP | RTF_HOST;
- error = rtrequest1(RTM_ADD, &info, NULL, 0);
+ error = rtrequest1(RTM_ADD, &info,
+ RTP_CONNECTED, NULL, 0);
rt_missmsg(RTM_ADD, &info, info.rti_flags,
&sc->sc_if, error, 0);
}
@@ -471,7 +472,7 @@ carp_setroute(struct carp_softc *sc, int cmd)
bzero(&info, sizeof(info));
info.rti_info[RTAX_DST] = &sa;
info.rti_info[RTAX_NETMASK] = ifa->ifa_netmask;
- error = rtrequest1(RTM_DELETE, &info, NULL, 0);
+ error = rtrequest1(RTM_DELETE, &info, RTP_CONNECTED, NULL, 0);
rt_missmsg(RTM_DELETE, &info, info.rti_flags, NULL,
error, 0);
}
@@ -485,7 +486,7 @@ carp_setroute(struct carp_softc *sc, int cmd)
info.rti_info[RTAX_NETMASK] = ifa->ifa_netmask;
info.rti_info[RTAX_LABEL] =
(struct sockaddr *)&sa_rl;
- error = rtrequest1(RTM_ADD, &info, NULL, 0);
+ error = rtrequest1(RTM_ADD, &info, RTP_CONNECTED, NULL, 0);
if (error == 0)
ifa->ifa_flags |= IFA_ROUTE;
rt_missmsg(RTM_ADD, &info, info.rti_flags,