Currently if a path is rejected because of parse errors there is only
a generic error message logged but it is not clear which prefix caused it.
Lets make this at least more obvious when 'log updates' is used.
OK?
--
:wq Claudio
Index: rde.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/rde.c,v
retrieving revision 1.414
diff -u -p -r1.414 rde.c
--- rde.c 9 Aug 2018 12:54:06 -0000 1.414
+++ rde.c 29 Aug 2018 09:19:05 -0000
@@ -1310,6 +1310,7 @@ rde_update_update(struct rde_peer *peer,
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,
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,
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);
}