From 81dfcaa2e27d53f4eb61c549e03065dcb1b8eec3 Mon Sep 17 00:00:00 2001 From: hasso Date: Sun, 25 May 2003 19:21:25 +0000 Subject: Route (reject|blackhole) support from 6Wind patch. --- zebra/kernel_socket.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'zebra/kernel_socket.c') diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c index a47f4f63..1e915d1d 100644 --- a/zebra/kernel_socket.c +++ b/zebra/kernel_socket.c @@ -148,6 +148,7 @@ rtm_flag_dump (int flag) struct message *mes; static char buf[BUFSIZ]; + buf[0] = '0'; for (mes = rtm_flag_str; mes->key != 0; mes++) { if (mes->key & flag) @@ -476,6 +477,12 @@ rtm_read (struct rt_msghdr *rtm) if (flags & RTF_STATIC) SET_FLAG (zebra_flags, ZEBRA_FLAG_STATIC); + /* This is a reject or blackhole route */ + if (flags & RTF_REJECT) + SET_FLAG (zebra_flags, ZEBRA_FLAG_REJECT); + if (flags & RTF_BLACKHOLE) + SET_FLAG (zebra_flags, ZEBRA_FLAG_BLACKHOLE); + if (dest.sa.sa_family == AF_INET) { struct prefix_ipv4 p; @@ -619,6 +626,9 @@ rtm_write (int message, /* Additional flags. */ if (zebra_flags & ZEBRA_FLAG_BLACKHOLE) msg.rtm.rtm_flags |= RTF_BLACKHOLE; + if (zebra_flags & ZEBRA_FLAG_REJECT) + msg.rtm.rtm_flags |= RTF_REJECT; + #ifdef HAVE_SIN_LEN #define SOCKADDRSET(X,R) \ -- cgit v1.2.1