diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-02-23 15:25:19 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-02-23 15:25:19 +0000 |
commit | 9acd79af6b916f0b7fcee2e6b4fc0b16bc68c081 (patch) | |
tree | 29f0625828039bffecc13753ef6609158692c7e9 /usr.sbin/bgpd | |
parent | 8c5fffac09f0248113e9a661c3957988a6fe290b (diff) |
Use the new rtm_fmask feature to reset blackhole and reject routes on
RTM_CHANGE. Until now it was not possible to get rid of these flags.
Until now a fib decouple, fib couple combo was needed to get rid from
blackholed routes. OK henning@
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/kroute.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c index fb15eaf33d7..bc33dddef2d 100644 --- a/usr.sbin/bgpd/kroute.c +++ b/usr.sbin/bgpd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.143 2006/01/31 15:22:15 claudio Exp $ */ +/* $OpenBSD: kroute.c,v 1.144 2006/02/23 15:25:18 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -1738,6 +1738,8 @@ send_rtmsg(int fd, int action, struct kroute *kroute) r.hdr.rtm_flags |= RTF_BLACKHOLE; if (kroute->flags & F_REJECT) r.hdr.rtm_flags |= RTF_REJECT; + if (action == RTM_CHANGE) /* reset these flags on change */ + r.hdr.rtm_fmask = RTF_REJECT|RTF_BLACKHOLE; r.hdr.rtm_seq = kr_state.rtseq++; /* overflow doesn't matter */ r.hdr.rtm_addrs = RTA_DST|RTA_GATEWAY|RTA_NETMASK|RTA_LABEL; r.prefix.sin_len = sizeof(r.prefix); |