summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-09-16 22:31:31 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-09-16 22:31:31 +0000
commit5143d65d315fdb722683cbbad4324a8a864007e4 (patch)
tree4035b3323459de3749e691081c6081acd27f395f /sys/net
parentcce6f8bb3aaa193e0d2562fc59e8b2e0f1f58d90 (diff)
handle route labels on RTM_CHANGE, ok mcbride, prodded my markus some time ago
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/route.c5
-rw-r--r--sys/net/route.h4
-rw-r--r--sys/net/rtsock.c9
3 files changed, 12 insertions, 6 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index de2d8041d3c..a78f86be3d2 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.49 2004/08/09 12:01:26 otto Exp $ */
+/* $OpenBSD: route.c,v 1.50 2004/09/16 22:31:30 henning Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
@@ -160,9 +160,6 @@ struct rt_label {
TAILQ_HEAD(rt_labels, rt_label) rt_labels = TAILQ_HEAD_INITIALIZER(rt_labels);
-u_int16_t rtlabel_name2id(char *);
-void rtlabel_unref(u_int16_t);
-
#ifdef IPSEC
struct ifaddr *
diff --git a/sys/net/route.h b/sys/net/route.h
index 59492260a12..79604cf3396 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.h,v 1.25 2004/09/16 00:21:11 henning Exp $ */
+/* $OpenBSD: route.h,v 1.26 2004/09/16 22:31:30 henning Exp $ */
/* $NetBSD: route.h,v 1.9 1996/02/13 22:00:49 christos Exp $ */
/*
@@ -295,6 +295,8 @@ struct sockaddr_rtlabel {
};
const char *rtlabel_id2name(u_int16_t);
+u_int16_t rtlabel_name2id(char *);
+void rtlabel_unref(u_int16_t);
#ifdef _KERNEL
#define RTFREE(rt) do { \
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 41962950d62..f19aabbf2cd 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsock.c,v 1.42 2004/08/03 11:22:15 henning Exp $ */
+/* $OpenBSD: rtsock.c,v 1.43 2004/09/16 22:31:29 henning Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
@@ -402,6 +402,13 @@ report:
rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, &info);
if (genmask)
rt->rt_genmask = genmask;
+ if (info.rti_info[RTAX_LABEL] != NULL) {
+ char *rtlabel = ((struct sockaddr_rtlabel *)
+ info.rti_info[RTAX_LABEL])->sr_label;
+ rtlabel_unref(rt->rt_labelid);
+ rt->rt_labelid =
+ rtlabel_name2id(rtlabel);
+ }
/* fallthrough */
case RTM_LOCK:
rt->rt_rmx.rmx_locks &= ~(rtm->rtm_inits);