diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-08-09 08:15:36 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-08-09 08:15:36 +0000 |
commit | ce81569ba0621198ae47d81865b43609d283649d (patch) | |
tree | 1e54fb7306c7bcfc76a4cfc5caf8e8375a290197 /usr.sbin/bgpd/rde_decide.c | |
parent | 9ad85f07bbf97940411d372dbeba42de17c5b6b5 (diff) |
Implement reception of multiple paths per BGP session. This is one
side of RFC7911 and the send portion will follow.
The path-id is extracted from the NLRI encoding an put into struct
prefix. To do this the prefix_by_peer() function gets a path-id
argument. If a session is not path-id enabled this argument will
be always 0. If a session is path-id enabled the value is taken
from the NLRI and can be anything, including 0. The value has no
meaning in itself. Still to make sure the decision process is able
to break a tie the path-id is checked as the last step (this is not
part of the RFC but required).
OK benno@
Diffstat (limited to 'usr.sbin/bgpd/rde_decide.c')
-rw-r--r-- | usr.sbin/bgpd/rde_decide.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/rde_decide.c b/usr.sbin/bgpd/rde_decide.c index d071beb83bc..f77f615030a 100644 --- a/usr.sbin/bgpd/rde_decide.c +++ b/usr.sbin/bgpd/rde_decide.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_decide.c,v 1.85 2021/05/04 09:21:05 claudio Exp $ */ +/* $OpenBSD: rde_decide.c,v 1.86 2021/08/09 08:15:34 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> @@ -281,6 +281,13 @@ prefix_cmp(struct prefix *p1, struct prefix *p2, int *testall) if (i > 0) return -1; + /* XXX RFC7911 does not specify this but it is needed. */ + /* 13. lowest path identifier wins */ + if (p1->path_id < p2->path_id) + return 1; + if (p1->path_id > p2->path_id) + return -1; + fatalx("Uh, oh a politician in the decision process"); } |