On Tue, May 18, 2021 at 12:48:06PM +0200, Claudio Jeker wrote:
> Our four-byte AS support dates back to the days of the original draft.
> Since then a new RFC 6793 got released that adjusted the error handling a
> bit. RFC 6793 just treats any error on AS4_PATH attribute with attribute
> drop with the hope that the AS_PATH is better.
>
> The reason is a bit questionable:
> Given that the two-octet AS numbers dominate during the transition
> and are carried in the AS_PATH attribute by an OLD BGP speaker, in
> this document the "attribute discard" approach is chosen to handle a
> malformed AS4_PATH attribute.
> My IPv4 feed has 41148 of 71059 or 57% two-octet AS numbers. I would not
> call that "dominate" (maybe the transition period is over...)
>
> Anyway, lets follow the standard
Ping
--
:wq Claudio
Index: bgpd.8
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/bgpd.8,v
retrieving revision 1.66
diff -u -p -r1.66 bgpd.8
--- bgpd.8 27 Apr 2021 11:34:58 -0000 1.66
+++ bgpd.8 18 May 2021 10:04:47 -0000
@@ -317,14 +317,6 @@ has been started.
.Re
.Pp
.Rs
-.%A Q. Vohra
-.%A E. Chen
-.%D May 2007
-.%R RFC 4893
-.%T BGP Support for Four-octet AS Number Space
-.Re
-.Pp
-.Rs
.%A V. Gill
.%A J. Heasley
.%A D. Meyer
@@ -349,6 +341,14 @@ has been started.
.%D June 2011
.%R RFC 6286
.%T Autonomous-System-Wide Unique BGP Identifier for BGP-4
+.Re
+.Pp
+.Rs
+.%A Q. Vohra
+.%A E. Chen
+.%D Dec 2012
+.%R RFC 6793
+.%T BGP Support for Four-Octet Autonomous System (AS) Number Space
.Re
.Pp
.Rs
Index: rde.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/rde.c,v
retrieving revision 1.520
diff -u -p -r1.520 rde.c
--- rde.c 6 May 2021 09:18:54 -0000 1.520
+++ rde.c 18 May 2021 10:29:15 -0000
@@ -1918,27 +1918,11 @@ bad_flags:
goto bad_flags;
if ((error = aspath_verify(p, attr_len, 1,
rde_no_as_set(peer))) != 0) {
- /*
- * XXX RFC does not specify how to handle errors.
- * XXX Instead of dropping the session because of a
- * XXX bad path just mark the full update as having
- * XXX a parse error which makes the update no longer
- * XXX eligible and will not be considered for routing
- * XXX or redistribution.
- * XXX We follow draft-ietf-idr-optional-transitive
- * XXX by looking at the partial bit.
- * XXX Consider soft errors similar to a partial attr.
- */
- if (flags & ATTR_PARTIAL || error == AS_ERR_SOFT) {
- a->flags |= F_ATTR_PARSE_ERR;
- log_peer_warnx(&peer->conf, "bad AS4_PATH, "
- "path invalidated and prefix withdrawn");
- goto optattr;
- } else {
- rde_update_err(peer, ERR_UPDATE, ERR_UPD_ASPATH,
- NULL, 0);
- return (-1);
- }
+ /* As per RFC6793 use "attribute discard" here. */
+ log_peer_warnx(&peer->conf, "bad AS4_PATH, "
+ "attribute discarded");
+ plen += attr_len;
+ break;
}
a->flags |= F_ATTR_AS4BYTE_NEW;
goto optattr;