diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-09-08 08:20:46 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-09-08 08:20:46 +0000 |
commit | 4c55da9abcff6f1fb774f6cafd4fd75e6eba73f0 (patch) | |
tree | b6b3a2f65a099f2f1e64393edd6c13c1a5b64fbb | |
parent | aedb556b2f3c2c3d1954efd853f4037812d74383 (diff) |
Switch the MPLS blocks for RTM_CHANGE. Do not always remove the MPLS
information if the gateway changes, since real MPLS routes need to
change gateway and outgoing label on topology changes. So if there is
MPLS information and an outgoing label do a proper change but if the
gateway of a non-MPLS route is changed remove the MPLS path since it is
no longer valid.
OK michele@
-rw-r--r-- | sys/net/rtsock.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index a0937703e44..8ce7a51c7e9 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsock.c,v 1.108 2010/09/02 09:38:05 blambert Exp $ */ +/* $OpenBSD: rtsock.c,v 1.109 2010/09/08 08:20:45 claudio Exp $ */ /* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */ /* @@ -733,16 +733,7 @@ report: } } #ifdef MPLS - /* if gateway changed remove MPLS information */ - if (newgate || ((rtm->rtm_fmask & RTF_MPLS) && - !(rtm->rtm_flags & RTF_MPLS))) { - if (rt->rt_llinfo != NULL && - rt->rt_flags & RTF_MPLS) { - free(rt->rt_llinfo, M_TEMP); - rt->rt_llinfo = NULL; - rt->rt_flags &= ~RTF_MPLS; - } - } else if ((rtm->rtm_flags & RTF_MPLS) && + if ((rtm->rtm_flags & RTF_MPLS) && info.rti_info[RTAX_SRC] != NULL) { struct rt_mpls *rt_mpls; @@ -771,6 +762,15 @@ report: /* XXX: set experimental bits */ rt->rt_flags |= RTF_MPLS; + } else if (newgate || ((rtm->rtm_fmask & RTF_MPLS) && + !(rtm->rtm_flags & RTF_MPLS))) { + /* if gateway changed remove MPLS information */ + if (rt->rt_llinfo != NULL && + rt->rt_flags & RTF_MPLS) { + free(rt->rt_llinfo, M_TEMP); + rt->rt_llinfo = NULL; + rt->rt_flags &= ~RTF_MPLS; + } } #endif /* Hack to allow some flags to be toggled */ |