From 516a4ed24c985559253d5bb93386fb9e884c9b4b Mon Sep 17 00:00:00 2001 From: claudio Date: Wed, 29 Aug 2018 11:46:28 +0000 Subject: [PATCH] When 'log updates' is enabled make sure that the case of an invalid path can be distinguished from a withdraw that was caused by a deny filter. OK sthen@ --- usr.sbin/bgpd/rde.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 5d8053c9a17..6ba3a49efa1 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.414 2018/08/09 12:54:06 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.415 2018/08/29 11:46:28 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -1310,6 +1310,7 @@ rde_update_update(struct rde_peer *peer, struct filterstate *in, struct prefix *p; enum filter_actions action; u_int16_t i; + const char *wmsg = "filtered, withdraw"; peer->prefix_rcvd_update++; /* add original path to the Adj-RIB-In */ @@ -1324,6 +1325,9 @@ rde_update_update(struct rde_peer *peer, struct filterstate *in, return (-1); } + if (in->aspath.flags & F_ATTR_PARSE_ERR) + wmsg = "path invalid, withdraw"; + p = prefix_get(&ribs[RIB_ADJ_IN].rib, peer, prefix, prefixlen, 0); if (p == NULL) fatalx("rde_update_update: no prefix in Adj-RIB-In"); @@ -1344,7 +1348,7 @@ rde_update_update(struct rde_peer *peer, struct filterstate *in, prefixlen, 0); } else if (prefix_remove(&ribs[i].rib, peer, prefix, prefixlen, 0)) { - rde_update_log("filtered withdraw", i, peer, + rde_update_log(wmsg, i, peer, NULL, prefix, prefixlen); } -- 2.20.1