summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2006-06-16 13:50:56 +0000
committerclaudio <claudio@openbsd.org>2006-06-16 13:50:56 +0000
commit3aaeee9f3f77b85ad4b77e5877f13a63de8c09c3 (patch)
tree6f78290ae88f6767e0cea1151440e95c31b76cd5
parentadopt to recent changes (diff)
downloadwireguard-openbsd-3aaeee9f3f77b85ad4b77e5877f13a63de8c09c3.tar.xz
wireguard-openbsd-3aaeee9f3f77b85ad4b77e5877f13a63de8c09c3.zip
Don't use rmx_hopcount any longer. The kernel ignores it anyway.
OK henning@, norby@, hshoexer@
-rw-r--r--sbin/routed/table.c12
-rw-r--r--usr.sbin/route6d/route6d.c9
2 files changed, 5 insertions, 16 deletions
diff --git a/sbin/routed/table.c b/sbin/routed/table.c
index 5cd6455272b..158ff8c0416 100644
--- a/sbin/routed/table.c
+++ b/sbin/routed/table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: table.c,v 1.18 2005/04/12 15:26:47 cloder Exp $ */
+/* $OpenBSD: table.c,v 1.19 2006/06/16 13:50:56 claudio Exp $ */
/*
* Copyright (c) 1983, 1988, 1993
@@ -660,10 +660,6 @@ again:
w.w_rtm.rtm_flags = flags;
w.w_rtm.rtm_seq = ++rt_sock_seqno;
w.w_rtm.rtm_addrs = RTA_DST|RTA_GATEWAY;
- if (metric != 0) {
- w.w_rtm.rtm_rmx.rmx_hopcount = metric;
- w.w_rtm.rtm_inits |= RTV_HOPCOUNT;
- }
w.w_dst.sin_family = AF_INET;
w.w_dst.sin_addr.s_addr = dst;
w.w_gate.sin_family = AF_INET;
@@ -842,11 +838,7 @@ rtm_add(struct rt_msghdr *rtm,
if (k->k_state & KS_NEW)
k->k_keep = now.tv_sec+keep;
k->k_gate = S_ADDR(INFO_GATE(info));
- k->k_metric = rtm->rtm_rmx.rmx_hopcount;
- if (k->k_metric < 0)
- k->k_metric = 0;
- else if (k->k_metric > HOPCNT_INFINITY)
- k->k_metric = HOPCNT_INFINITY;
+ k->k_metric = 0;
k->k_state &= ~(KS_DELETED | KS_GATEWAY | KS_STATIC | KS_NEW);
if (rtm->rtm_flags & RTF_GATEWAY)
k->k_state |= KS_GATEWAY;
diff --git a/usr.sbin/route6d/route6d.c b/usr.sbin/route6d/route6d.c
index ad0ee22f25f..27c39c118ff 100644
--- a/usr.sbin/route6d/route6d.c
+++ b/usr.sbin/route6d/route6d.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route6d.c,v 1.44 2006/04/02 21:38:55 djm Exp $ */
+/* $OpenBSD: route6d.c,v 1.45 2006/06/16 13:51:21 claudio Exp $ */
/* $KAME: route6d.c,v 1.94 2002/10/26 20:08:55 itojun Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#if 0
-static char _rcsid[] = "$OpenBSD: route6d.c,v 1.44 2006/04/02 21:38:55 djm Exp $";
+static char _rcsid[] = "$OpenBSD: route6d.c,v 1.45 2006/06/16 13:51:21 claudio Exp $";
#endif
#include <stdio.h>
@@ -2566,9 +2566,7 @@ rt_entry(struct rt_msghdr *rtm, int again)
if ((rtm->rtm_flags & (RTF_HOST|RTF_GATEWAY)) == RTF_HOST)
rrt->rrt_t = 0; /* Don't age non-gateway host routes */
np->rip6_tag = 0;
- np->rip6_metric = rtm->rtm_rmx.rmx_hopcount;
- if (np->rip6_metric < 1)
- np->rip6_metric = 1;
+ np->rip6_metric = 1;
rrt->rrt_flags = rtm->rtm_flags;
np->rip6_dest = sin6_dst->sin6_addr;
@@ -2680,7 +2678,6 @@ addroute(struct riprt *rrt, const struct in6_addr *gw, struct ifc *ifcp)
rtm->rtm_pid = pid;
rtm->rtm_flags = rrt->rrt_flags;
rtm->rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK;
- rtm->rtm_rmx.rmx_hopcount = np->rip6_metric - 1;
rtm->rtm_inits = RTV_HOPCOUNT;
sin6 = (struct sockaddr_in6 *)&buf[sizeof(struct rt_msghdr)];
/* Destination */