Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI testrun #20

Closed
wants to merge 320 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
320 commits
Select commit Hold shift + click to select a range
7a56747
Add basic infrastructure for SR Policies in zebra
GalaxyGorilla Jan 14, 2020
b8921ad
Add operational status to Zebra SR Policies
GalaxyGorilla Jan 15, 2020
e4286d9
Support Zebra Policy Deletion
GalaxyGorilla Jan 15, 2020
ccdc58c
Update Zebra SR Policies when possible nexthops are discovered
GalaxyGorilla Jan 16, 2020
a78dc71
Fix some memory issues in zebra's SR Policy handling
GalaxyGorilla Jan 16, 2020
08476fa
Add hooks for created or removed MPLS labels for Zebra SRTE
GalaxyGorilla Jan 17, 2020
0168983
Add configuration for overriding pcc address and port
sylane Jan 17, 2020
7fe812a
pathd: Make the pcc command a node so the pce is a sub-command
sylane Jan 17, 2020
9cd95a1
vtysh: add missing PCE node to fix startup error
rwestphal Jan 21, 2020
93de3d8
pathd: send SR-TE policies to zebra once connection is established
rwestphal Jan 21, 2020
5a4438f
pathd: fix the SR-TE policy rb-tree compare function
rwestphal Jan 21, 2020
6562869
zebra, pathd: convert from strncpy() to strlcpy()
rwestphal Jan 21, 2020
ce9fc58
pathd: fix rb-tree initialization
rwestphal Jan 21, 2020
886dc89
pathd: fix misuse of the nb_running_get_entry() function
rwestphal Jan 21, 2020
8edff83
pathd: "no name" should work without any extra argument
rwestphal Jan 21, 2020
2d5c701
pathd: plug a few minor memleaks
rwestphal Jan 21, 2020
8d372eb
pathd: don't use strdup() to allocate memory
rwestphal Jan 21, 2020
fbf0572
pathd: fix a few more memleaks
rwestphal Jan 21, 2020
48b6f97
zebra: refactor the SR-TE code a little bit
rwestphal Jan 21, 2020
24bb2ee
zebra: update Binding-SIDs whenever the top-level SID changes
rwestphal Jan 21, 2020
e76ba3e
Add zebra policy status and notification to pathd
GalaxyGorilla Jan 24, 2020
aa7f347
Add zebra's status for SR policies to operational data
GalaxyGorilla Jan 24, 2020
d2abd78
pathd: add candidate path hooks
sylane Jan 22, 2020
05c8e7d
pathd: implement candidate path hooks in pcep module
sylane Jan 24, 2020
9c476b8
Add code infrastructure for SR Policy support in route-maps
GalaxyGorilla Jan 28, 2020
a348f8f
Store SR-TE information in bgp_path_info
GalaxyGorilla Jan 28, 2020
5bffef0
pathd: zebra status handling, and hook triggering fixes
sylane Jan 30, 2020
b3b9a01
pathd: update pcep module for the new pceplib API
sylane Feb 4, 2020
5eb26e2
pathd: remove pcep module typedefs
sylane Feb 4, 2020
5783ecc
pathd: fix the pcep module code formating
sylane Feb 4, 2020
aed4b27
Introduce ZAPI_MESSAGE_SRTE
GalaxyGorilla Feb 4, 2020
9959cb2
ZAPI message encoding/decoding for BGP SR-TE info
GalaxyGorilla Feb 4, 2020
eef8dbe
Fix policy name parsing in zebra
GalaxyGorilla Feb 5, 2020
9b3456b
pathd: update for the pceplib API changes
sylane Feb 5, 2020
4e8bd7b
Resolve SR Policy name on BGP initiated route
GalaxyGorilla Feb 5, 2020
bd134e9
Resolve SR Policies in case of route-map SR-TE colors
GalaxyGorilla Feb 6, 2020
1e43337
Print pathd config correctly ('explicit' was missing)
GalaxyGorilla Feb 6, 2020
dc3a504
Make gcc 4.9 happy
GalaxyGorilla Feb 6, 2020
39ada4a
Bring SR-TE color into nexthop processing
GalaxyGorilla Feb 10, 2020
2a5faf2
zebra: add #include guards in the zebra_srte.h header
rwestphal Feb 11, 2020
258ee50
zebra: allow routes to recurse on SR policies
rwestphal Feb 11, 2020
3a0800a
Cleanup of obsolete config infra for SR-TE
GalaxyGorilla Feb 12, 2020
dfb4952
Add 'show sr-te policy [detail]' command
GalaxyGorilla Feb 13, 2020
4d6c7bb
zebra, pathd: add support for SR policies w/ ipv6 endpoints
rwestphal Feb 13, 2020
7725e4a
zebra: validate the address family of the first SID of SR policies
rwestphal Feb 13, 2020
c5611d4
zebra, pathd: remove some code duplication
rwestphal Feb 13, 2020
36d21f3
lib: sort SR policies by endpoint first then by color
rwestphal Feb 13, 2020
48f5735
pathd: fix LSP not being removed from zebra
sylane Feb 13, 2020
d398503
pathd: better fix for ODL expecting a DOWN status in a report after a…
sylane Feb 13, 2020
9cce653
pathd: simplify some rb-tree comparison functions
rwestphal Feb 13, 2020
7f903be
zebra: skip deleted nhlfes when installing a binding sid
rwestphal Feb 13, 2020
43e34ce
pathd: better debug logging, add pceplib logs
sylane Feb 14, 2020
4a55ad3
pathd: run clang-format to consolidate coding style
rwestphal Feb 14, 2020
226da41
zebra: install binding-sids with a custom protocol type
rwestphal Feb 14, 2020
045f1bb
zebra: another fix in the installation of binding-sids
rwestphal Feb 14, 2020
7430feb
pathd: remove dead code
rwestphal Feb 14, 2020
b85a0d2
pathd: use fixed-size buffers to hold config data
rwestphal Feb 14, 2020
37ac4f5
staticd: Add support for SR-Policies
GalaxyGorilla Feb 14, 2020
404aa46
pathd: fix segment list name handling
GalaxyGorilla Feb 14, 2020
56752a5
staticd: Add support for SR-Policies (ipv6, not working bc of pathd yet)
GalaxyGorilla Feb 14, 2020
28fea79
pathd: avoid unnecessary lookups of the best candidate path
rwestphal Feb 14, 2020
7db9b1c
pathd: avoid unnecessary lookups of segment-lists
rwestphal Feb 14, 2020
d76d9dd
pathd: small code simplification
rwestphal Feb 14, 2020
f0b1494
pathd: allow unsetting the binding-sid + remove unnecessary wrappers
rwestphal Feb 14, 2020
7dc6838
pathd: move some code around
rwestphal Feb 14, 2020
38246ec
pathd, yang: segment sid-value should be mandatory
rwestphal Feb 15, 2020
6858d5e
pathd: plug two small memleaks
rwestphal Feb 15, 2020
bbcf525
pathd: rename several structures, variables and functions (style rework)
rwestphal Feb 14, 2020
4ea5c5d
pathd, yang: update definition of the protocol-origin leaf
rwestphal Feb 15, 2020
df31bb7
pathd: simplify the "candidate-path" command
rwestphal Feb 15, 2020
ed786b6
pathd, zebra: fix handling of binding-sid changes
rwestphal Feb 15, 2020
00c87e8
pathd: print colors as unsigned integers
rwestphal Feb 15, 2020
7b09355
pathd: request binding-sid labels to the LM
rwestphal Feb 15, 2020
d0c17ea
pathd: fix pcep module after refactoring
sylane Feb 17, 2020
e9dd0ce
pathd: remove unneeded change and unneeded check
sylane Feb 17, 2020
5c20340
pathd: add error description file
sylane Feb 17, 2020
f5a2882
pathd: fix refactor bug where segment list were handled after candida…
sylane Feb 17, 2020
193f5dc
pathd: rework handling of new/deleted/modified candidate paths (exper…
rwestphal Feb 17, 2020
a86d914
pathd: fix crash from setting the flag to wrong candidate path
sylane Feb 18, 2020
b260c34
pathd: handle the case when the best candidate segment list changes
sylane Feb 18, 2020
e130311
pathd: fix the hook call order when a candidate is deleted and changed
sylane Feb 18, 2020
7be3a5f
pathd: remove unnecessary check
rwestphal Feb 18, 2020
4268bdb
pathd: Remove irrelevant check
GalaxyGorilla Feb 18, 2020
caa27a1
pathd: fix build warning without pcep module enabled
sylane Feb 19, 2020
705bc23
Add minimal test topo for SR-TE
GalaxyGorilla Feb 19, 2020
a1c7c1c
pathd: Add testcase for adding a single candidate path to a SR Policy
GalaxyGorilla Feb 20, 2020
8a4bf55
pathd: Add testcase for removing a single candidate path from a SR Po…
GalaxyGorilla Feb 20, 2020
ae9020c
pathd: Check MPLS table in tests and a bit of refactoring
GalaxyGorilla Feb 20, 2020
b22aaab
pathd: update installed policy when changing the segment list
sylane Feb 20, 2020
779bb42
pathd: Add tests for Candidate Paths selection
GalaxyGorilla Feb 20, 2020
4f06190
pathd: remove unnecessary include file
sylane Feb 20, 2020
1d2f74d
pathd: Introduce some helpers for topotests
GalaxyGorilla Feb 21, 2020
b74fc67
pathd: Simplify topotest testcase setup
GalaxyGorilla Feb 21, 2020
3d4d267
pathd: Split MPLS and operational data related tests
GalaxyGorilla Feb 21, 2020
1fe56aa
pathd: pcep module: add capability parsing from open message
sylane Feb 21, 2020
0711a8c
pathd: Use exact JSON matching in topotests where appropriate
GalaxyGorilla Feb 21, 2020
ff7108d
zebra: Print whole label stack in 'show mpls table json'
GalaxyGorilla Feb 21, 2020
fa07265
pathd: Add test for changing segment lists in candidate path
GalaxyGorilla Feb 21, 2020
775eaf2
pathd: pcep module: refactor PCE synchronization
sylane Feb 21, 2020
b03f8c9
pathd: pcep module: slightly better logging
sylane Feb 21, 2020
075af50
pathd: Refactor candidate handling in tests
GalaxyGorilla Feb 24, 2020
5e5da7c
pathd: Add test for BGP route-map configuration
GalaxyGorilla Feb 25, 2020
ee602d1
pathd: Cleanup test print
GalaxyGorilla Feb 25, 2020
995b359
pathd: Add tests for modifying segment lists
GalaxyGorilla Feb 25, 2020
f151bc6
pathd: pcep module: Add computation request and force stateless flag
sylane Feb 26, 2020
a75e997
pathd: Add test for re-installation of policies (not working)
GalaxyGorilla Feb 26, 2020
206eef8
pathd: Release label when SR Policy is deleted
GalaxyGorilla Feb 27, 2020
df2b723
zebra: Fix selection of label chunks in label manager
GalaxyGorilla Feb 27, 2020
9c004f8
pathd: Don't allow modifying a set SR Policy name
GalaxyGorilla Feb 28, 2020
b1b21c8
pathd: pcep module: refactor the pcep module code
sylane Mar 2, 2020
eb49521
pathd: fix vtysh exit of the pcc command
sylane Mar 2, 2020
c126111
pathd: small fix to account for reserved labels in binding SID command
sylane Mar 3, 2020
d5097f1
pathd: pcep module: do not close the connection on open message event
sylane Mar 4, 2020
be843f4
pathd: Don't allow setting candidate name more than one time
GalaxyGorilla Mar 9, 2020
47d18a2
lib: add possibility to search non-recursively for NB node entries
GalaxyGorilla Mar 10, 2020
ec324ba
pathd: Fix NULL pointer handling for candidate names
GalaxyGorilla Mar 10, 2020
6dd2c5b
pathd: Don't allow setting candidate type more than one time
GalaxyGorilla Mar 10, 2020
d316e9c
pathd: pcep module: Fix pcc command port handling
sylane Mar 5, 2020
bbd650d
pathd: pcep module: fix debug command
sylane Mar 5, 2020
ad64374
pathd: pcep module: Fix the printing of the pcc command
sylane Mar 5, 2020
36383af
pathd: pcep module: fix pceplib logging
sylane Mar 10, 2020
c73151d
doc: Add basic user docu for pathd
GalaxyGorilla Mar 11, 2020
279315d
doc: Add [no] tags to pathd config commands where necessary
GalaxyGorilla Mar 11, 2020
9ce3777
staticd: Honor the SR-TE color when printing the config
GalaxyGorilla Mar 16, 2020
8a3f2c5
staticd: Extend SR-TE color handling to all commands
GalaxyGorilla Mar 16, 2020
465c51a
staticd: Fix typo regarding SR-TE color handling
GalaxyGorilla Mar 16, 2020
adcb1df
staticd: Fix initialisation of SR-TE color
GalaxyGorilla Mar 16, 2020
9f216c6
pathd: pcep module: add flag to use SR draft07
sylane Mar 17, 2020
73def61
pathd: pcep module: add documentation for draft 07 configuration flag
sylane Mar 17, 2020
3a96598
pathd: pcep module: cancel reconnection when updating the pce address
sylane Mar 17, 2020
9bb3a99
staticd: fix SR-TE color handling for route updates
GalaxyGorilla Mar 23, 2020
7753b9f
tools: add frr-reload.py fixes for pathd
edipascale Mar 3, 2020
0549a9b
pathd: pcep module: add PCE's SR draft07 flag to running config display
sylane Mar 24, 2020
94499c4
pathd: Fix bug that made pathd crash when removing then adding a segm…
sylane Mar 24, 2020
18bd960
pathd: pcep module: Fix crash when a segment list is empty
sylane Mar 26, 2020
fcbd9bb
zebra: skip inactive LSPs when validating SR policies
rwestphal Mar 27, 2020
59935a7
Revert "zebra: skip inactive LSPs when validating SR policies"
GalaxyGorilla Mar 27, 2020
1469be0
zebra: Check if NHLFE is set for SR Policies
GalaxyGorilla Mar 27, 2020
02fe8ac
pathd: pcep module: add command to show pceplib counters
sylane Mar 30, 2020
e881c1b
pathd: pcep module: Add jittered exponential backoff for PCE connections
sylane Mar 31, 2020
30eaee6
zebra, bgpd: reevaluate dependant BGP routes whenever an SR-policy is…
rwestphal Mar 31, 2020
45fe87e
bgpd: convert NHT code to use rb-trees instead of routing tables
rwestphal Apr 9, 2020
d32d780
lib, zebra: extend the ZAPI nexthop message to include the SR-TE color
rwestphal Apr 1, 2020
9cbb47d
bgpd: make NHT aware of SR-TE colors
rwestphal Apr 9, 2020
e2bec22
zebra: send actual nexthops used by SR policies
rwestphal Apr 10, 2020
3417071
bgpd: update attrhash_cmp() function to take SR-TE colors into account
rwestphal Apr 11, 2020
a6a6cee
lib: fix nexthop comparison to take SR-TE colors into account
rwestphal Apr 11, 2020
7aca36a
zebra: fix ECMP of routes recursing on SR policies
rwestphal Apr 11, 2020
8c0caab
zebra: display SR-TE color of routes
rwestphal Apr 11, 2020
9fb3f0f
zebra: notify client daemons when sr-policy is deleted
rwestphal Apr 11, 2020
a70fbdf
zebra: avoid reinstalling routes after updating binding-sid label
rwestphal Apr 11, 2020
94f174f
pathd: run clang-format once again
rwestphal Apr 11, 2020
541ffca
bgpd: workaround to routes dependant on non-existing SR-policies
rwestphal Apr 12, 2020
e7b4d28
pathd: update sync zclient to new API
rwestphal Apr 13, 2020
71bc27e
zebra: remove unnecessary function
rwestphal Apr 13, 2020
21a373b
Fix for pcep counters show with null session
Apr 14, 2020
7d19a61
zebra: notify status for for SR Policy updates
GalaxyGorilla Apr 15, 2020
4154219
zebra: reinstall MPLS stack for SR Policies if necessary
GalaxyGorilla Apr 15, 2020
ea523d2
Implement IPv6 PCEP connections
Apr 15, 2020
b4ab69d
CLANG Formatting changes for previous patch
Apr 16, 2020
fe8a37c
tests: remove workaround for BGP learned routes
GalaxyGorilla Apr 17, 2020
dcd13e5
tests: cover re-installation of SR Policies with BGP
GalaxyGorilla Apr 17, 2020
2edd4a9
tests: more testing on SR Policies, BGP and route-maps
GalaxyGorilla Apr 20, 2020
1444da3
Set the local PCC ip in v4 or v6.
Apr 21, 2020
5d647d7
pathd: pcep module: try specifying the LSP IDENTIFIER TLV
sylane Mar 19, 2020
f0c3a26
pathd: pcep module: try matching Cisco PCC reports
sylane Mar 20, 2020
99eeabb
pathd: pcep module: Try sending unknown Cisco LSP TLV
sylane Mar 26, 2020
18921dc
pathd: pcep module: Properly set the binding SID in the unknown Cisco…
sylane Mar 27, 2020
dca7cf1
pathd: pcep module: Try matching Cisco report format even more
sylane Mar 31, 2020
636549b
pathd: pcep module: Send leaner sync done reports
sylane Mar 31, 2020
3c29088
pathd: pcep module: make LSP updates' responses more robust
sylane Apr 2, 2020
77f5922
pathd: add support for candidate path metrics
sylane Apr 6, 2020
5571b9c
pathd: add the metrics to the show config command
sylane Apr 7, 2020
9a1ef1b
pathd: pcep module: add metric handling for PCE messages
sylane Apr 7, 2020
37b4438
pathd: pcep module: fix invalid flags for TE metric in PCC reports
sylane Apr 8, 2020
14130d4
pathd: add optional NAI specification in segments
sylane Apr 8, 2020
c4bb213
pathd: pcep module: add support for SR segment NAI
sylane Apr 9, 2020
cf74d59
zebra, pathd: add log for policy status updates
sylane Apr 15, 2020
ada41df
pathd: pcep module: remove debug command force_stateless
sylane Apr 16, 2020
c910b41
pathd: pcep module: restore original initial identifiers for plspid, …
sylane Apr 20, 2020
ac1dd28
pathd: pcep module: removes changes not required by Cisco PCE
sylane Apr 21, 2020
341c324
pathd: Coding style and documentation changes
sylane Apr 21, 2020
4d12f25
pathd: pcep module: update sample configuration
sylane Apr 21, 2020
29d8cca
pathd: Fix candidate removal hook
sylane Apr 23, 2020
42d7be7
pathd: Fix metrics configuration display
sylane Apr 23, 2020
7cfed23
pathd: pcep module: add no pcc command
sylane Apr 23, 2020
94695df
pathd: filter out the segment lists generated by PCEP in show config
sylane Apr 24, 2020
efa9f0d
pathd: pcep module: Fix PCEP sync flag parsing bug
sylane Apr 28, 2020
83f3f2d
pathd: pcep module: Add origin and originator to segment list
sylane Apr 28, 2020
7644a08
pcep module: better segment list cleanup during LSP update
sylane Apr 28, 2020
79b4223
pcep module: send the reports with SRP ID synchronously to preserve o…
sylane Apr 28, 2020
9810a48
pcep module: Fix the update message response logic
sylane Apr 28, 2020
907654d
lib, pathd: introduce the northbound context structure (experimental)
rwestphal Apr 27, 2020
fc5af87
pathd: pcep module: fix metrics changed by the PCE showing up in config
sylane May 4, 2020
5402dbf
pathd: pcep module: Revert the ip argument of the pcc comand to optional
sylane May 6, 2020
71e2df1
WIP: Plugin FRR memory infra into PCEPlib
Apr 23, 2020
b271479
pathd: use the fix for unsetting metrics too
sylane May 7, 2020
dd44ef3
pathd: add bandwidth metadata to candidate path
sylane May 7, 2020
e88d9a6
pathd: pcep module: add support for candidate path bandwidth requirem…
sylane May 8, 2020
d3abdfc
pathd: pcep module: show bandwidth parameter in 'show running-config'…
sylane May 8, 2020
6c696ed
pathd: pcep module: Fix PCC removal
sylane May 13, 2020
b753766
Reject unsupported PcInitate PCEP messages
May 12, 2020
a9f566e
zebra: consume Adj-SID labels when they are in the beginning of the SL
rwestphal May 16, 2020
ce76713
Plugin FRR timers infra into PCEPlib
Apr 29, 2020
5af574e
Plugin FRR socket infra into PCEPlib
May 8, 2020
7ea2b9b
New config parameter (msd) in pcc configuration
May 11, 2020
92cc285
Check for duplicate configuration before disconnecting
May 20, 2020
d7b4ba6
pathd: pcep module: filter out the candidate paths with incompatible …
sylane May 20, 2020
e88f89c
pathd: pcep module: support IPv6 LSP identifiers
sylane May 20, 2020
8406014
Adapt to msd handling to revert the ip pcc comand to optional
sylane May 6, 2020
9ea1559
Delete candidate when segment list name is empty
May 21, 2020
46390ab
Check returns for paths lookups
May 21, 2020
a3b7322
pathd: pcep module: Make transport IP versions independent from proto…
sylane May 22, 2020
6aa7879
pathd: pcep module: formating cleanup and function extraction
sylane May 22, 2020
9eb8ab7
Do not poll pceplib pcep_events anymore
May 27, 2020
48abc5d
tests: add 'outLabelStack' to OSPF SR tests
GalaxyGorilla Jun 10, 2020
e1a643e
zebra: lib: fix handling of SR TE colors
GalaxyGorilla Jun 10, 2020
3ee8998
pathd: pcep module: quick hack to prevent crashes when logging from n…
sylane Jun 11, 2020
0936d14
tests: update BGP topotest to new 'show bgp next' output
GalaxyGorilla Jun 12, 2020
fefd14f
zebra: staticd: fix integer initialization
GalaxyGorilla Jun 12, 2020
0d62adf
Allow FRR to create and manage PCEPlib pthreads
Jun 12, 2020
3df55cd
lib: add srte.h to pkg include headers
GalaxyGorilla Jun 15, 2020
da36950
pathd: add path_util.h to header list
GalaxyGorilla Jun 15, 2020
37c8d41
pathd: fix xpath truncation warnings
GalaxyGorilla Jun 15, 2020
39696ce
zebra: add header for BSD types
GalaxyGorilla Jun 15, 2020
2c858ce
Hot fix to avoid assert happens in reconect
May 22, 2020
6147fc3
doc: add path.rst to docfiles
GalaxyGorilla Jun 15, 2020
2024d2d
zebra: move types.h to the right place
GalaxyGorilla Jun 15, 2020
8e7e9fd
doc: put pathd docu in the user docu toctree
GalaxyGorilla Jun 15, 2020
9b0eec8
zebra: use stdint.h for BSD types
GalaxyGorilla Jun 15, 2020
428d1cb
zebra: use zebra.h for BSD related headers
GalaxyGorilla Jun 15, 2020
260876a
tools: add pathd to startscript
GalaxyGorilla Jun 15, 2020
eaa58fa
redhat: add pathd to build script
GalaxyGorilla Jun 15, 2020
678424d
pathd: pcep module: cleanup some release fix and some formating
sylane Jun 15, 2020
96c75c8
zebra: align nexthop encoding with prior refactor
GalaxyGorilla Jun 18, 2020
7d810a2
pathd: handle access lists to prevent error logs
GalaxyGorilla Jun 26, 2020
25fac0b
bgp: remove unneccessary setting of peers
GalaxyGorilla Jun 26, 2020
70c4075
path: pcep module: change the synchronization workflow.
sylane Jun 19, 2020
87040f3
pathd: pcep module: update for the new pceplib error definitions
sylane Jun 25, 2020
6316e82
Changes due to recent PCEPlib API changes
Jun 29, 2020
8764e87
pathd: fix heap use after deletion
GalaxyGorilla Jun 29, 2020
8ce9a96
bgpd: do not unregister for prefix nexthop updates if nh exists
pjdruddy Jun 26, 2020
bc2e28e
pathd: use some further path options in tests
GalaxyGorilla Jun 30, 2020
45e5197
Use PCEPlib timers instead of FRR timers for now
Jul 1, 2020
20d5851
pathd: pcep module: prevent any possible disconnection race leading t…
sylane Jul 2, 2020
73a9af9
Fix minor build warnings
Jul 6, 2020
9c552cf
pathd: pcep module: adds computation request timeout
sylane Jul 1, 2020
ee65a50
pathd: Starts adding some developer documentation
sylane Jul 13, 2020
8b2bed9
zebra: ensure that installed srte policies have an output label
sylane Jul 15, 2020
7a9efaa
Merge pull request #47 from opensourcerouting/pathd-pcep-zebra-crash
rwestphal Jul 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ include bfdd/subdir.am
include yang/subdir.am
include yang/libyang_plugins/subdir.am
include vrrpd/subdir.am
include pathd/subdir.am

include vtysh/subdir.am
include tests/subdir.am
Expand Down
3 changes: 2 additions & 1 deletion bgpd/bgp_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,8 @@ bool attrhash_cmp(const void *p1, const void *p2)
&& attr1->nh_lla_ifindex == attr2->nh_lla_ifindex
&& attr1->distance == attr2->distance
&& srv6_l3vpn_same(attr1->srv6_l3vpn, attr2->srv6_l3vpn)
&& srv6_vpn_same(attr1->srv6_vpn, attr2->srv6_vpn))
&& srv6_vpn_same(attr1->srv6_vpn, attr2->srv6_vpn)
&& attr1->srte_color == attr2->srte_color)
return true;
}

Expand Down
7 changes: 7 additions & 0 deletions bgpd/bgp_attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "mpls.h"
#include "bgp_attr_evpn.h"
#include "bgpd/bgp_encap_types.h"
#include "srte.h"

/* Simple bit mapping. */
#define BITMAP_NBBY 8
Expand Down Expand Up @@ -253,6 +254,12 @@ struct attr {

/* Link bandwidth value, if any. */
uint32_t link_bw;

/* SR-TE Policy Name */
char srte_policy[SRTE_POLICY_NAME_MAX_LENGTH];

/* SR-TE Color */
uint32_t srte_color;
};

/* rmap_change_flags definition */
Expand Down
129 changes: 73 additions & 56 deletions bgpd/bgp_nexthop.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "filter.h"

#include "bgpd/bgpd.h"
#include "bgpd/bgp_table.h"
#include "bgpd/bgp_route.h"
#include "bgpd/bgp_attr.h"
#include "bgpd/bgp_nexthop.h"
Expand All @@ -48,43 +47,86 @@

DEFINE_MTYPE_STATIC(BGPD, MARTIAN_STRING, "BGP Martian Address Intf String");

char *bnc_str(struct bgp_nexthop_cache *bnc, char *buf, int size)
static inline int bgp_nexthop_cache_compare(const struct bgp_nexthop_cache *a,
const struct bgp_nexthop_cache *b)
{
prefix2str(bgp_node_get_prefix(bnc->node), buf, size);
return buf;
if (a->srte_color < b->srte_color)
return -1;
if (a->srte_color > b->srte_color)
return 1;

return prefix_cmp(&a->prefix, &b->prefix);
}

RB_GENERATE(bgp_nexthop_cache_head, bgp_nexthop_cache, entry,
bgp_nexthop_cache_compare);

const char *bnc_str(struct bgp_nexthop_cache *bnc, char *buf, int size)
{
return prefix2str(&bnc->prefix, buf, size);
}

void bnc_nexthop_free(struct bgp_nexthop_cache *bnc)
{
nexthops_free(bnc->nexthop);
}

struct bgp_nexthop_cache *bnc_new(void)
struct bgp_nexthop_cache *bnc_new(struct bgp_nexthop_cache_head *tree,
struct prefix *prefix, uint32_t srte_color)
{
struct bgp_nexthop_cache *bnc;

bnc = XCALLOC(MTYPE_BGP_NEXTHOP_CACHE,
sizeof(struct bgp_nexthop_cache));
bnc->prefix = *prefix;
bnc->srte_color = srte_color;
bnc->tree = tree;
LIST_INIT(&(bnc->paths));
RB_INSERT(bgp_nexthop_cache_head, tree, bnc);

return bnc;
}

bool bnc_existing_for_prefix(struct bgp_nexthop_cache *bnc)
{
struct bgp_nexthop_cache *bnc_tmp;

RB_FOREACH (bnc_tmp, bgp_nexthop_cache_head, bnc->tree) {
if (bnc_tmp == bnc)
continue;
if (prefix_cmp(&bnc->prefix, &bnc_tmp->prefix) == 0)
return true;
}
return false;
}

void bnc_free(struct bgp_nexthop_cache *bnc)
{
bnc_nexthop_free(bnc);
RB_REMOVE(bgp_nexthop_cache_head, bnc->tree, bnc);
XFREE(MTYPE_BGP_NEXTHOP_CACHE, bnc);
}

struct bgp_nexthop_cache *bnc_find(struct bgp_nexthop_cache_head *tree,
struct prefix *prefix, uint32_t srte_color)
{
struct bgp_nexthop_cache bnc = {};

if (!tree)
return NULL;

bnc.prefix = *prefix;
bnc.srte_color = srte_color;
return RB_FIND(bgp_nexthop_cache_head, tree, &bnc);
}

/* Reset and free all BGP nexthop cache. */
static void bgp_nexthop_cache_reset(struct bgp_table *table)
static void bgp_nexthop_cache_reset(struct bgp_nexthop_cache_head *tree)
{
struct bgp_node *rn;
struct bgp_nexthop_cache *bnc;

for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn)) {
bnc = bgp_node_get_bgp_nexthop_info(rn);
if (!bnc)
continue;
while (!RB_EMPTY(bgp_nexthop_cache_head, tree)) {
bnc = RB_ROOT(bgp_nexthop_cache_head, tree);

while (!LIST_EMPTY(&(bnc->paths))) {
struct bgp_path_info *path = LIST_FIRST(&(bnc->paths));
Expand All @@ -93,8 +135,6 @@ static void bgp_nexthop_cache_reset(struct bgp_table *table)
}

bnc_free(bnc);
bgp_node_set_bgp_nexthop_info(rn, NULL);
bgp_unlock_node(rn);
}
}

Expand Down Expand Up @@ -772,29 +812,26 @@ static void bgp_show_nexthops_detail(struct vty *vty, struct bgp *bgp,
}

static void bgp_show_nexthop(struct vty *vty, struct bgp *bgp,
struct bgp_node *rn,
struct bgp_nexthop_cache *bnc,
bool specific)
{
char buf[PREFIX2STR_BUFFER];
time_t tbuf;
struct peer *peer;
const struct prefix *p = bgp_node_get_prefix(rn);

peer = (struct peer *)bnc->nht_info;

if (bnc->srte_color)
vty_out(vty, " SR-TE color %u -", bnc->srte_color);
if (CHECK_FLAG(bnc->flags, BGP_NEXTHOP_VALID)) {
vty_out(vty, " %s valid [IGP metric %d], #paths %d",
inet_ntop(p->family, &p->u.prefix, buf, sizeof(buf)),
bnc->metric, bnc->path_count);
vty_out(vty, " %pFX valid [IGP metric %d], #paths %d",
&bnc->prefix, bnc->metric, bnc->path_count);
if (peer)
vty_out(vty, ", peer %s", peer->host);
vty_out(vty, "\n");
bgp_show_nexthops_detail(vty, bgp, bnc);
} else {
vty_out(vty, " %s invalid, #paths %d",
inet_ntop(p->family, &p->u.prefix, buf, sizeof(buf)),
bnc->path_count);
vty_out(vty, " %pFX invalid, #paths %d",
&bnc->prefix, bnc->path_count);
if (peer)
vty_out(vty, ", peer %s", peer->host);
vty_out(vty, "\n");
Expand All @@ -815,29 +852,21 @@ static void bgp_show_nexthop(struct vty *vty, struct bgp *bgp,
static void bgp_show_nexthops(struct vty *vty, struct bgp *bgp,
bool import_table)
{
struct bgp_node *rn;
struct bgp_nexthop_cache *bnc;
afi_t afi;
struct bgp_table **table;
struct bgp_nexthop_cache_head (*tree)[AFI_MAX];

if (import_table)
vty_out(vty, "Current BGP import check cache:\n");
else
vty_out(vty, "Current BGP nexthop cache:\n");
if (import_table)
table = bgp->import_check_table;
tree = &bgp->import_check_table;
else
table = bgp->nexthop_cache_table;
tree = &bgp->nexthop_cache_table;
for (afi = AFI_IP; afi < AFI_MAX; afi++) {
if (!table || !table[afi])
continue;
for (rn = bgp_table_top(table[afi]); rn;
rn = bgp_route_next(rn)) {
bnc = bgp_node_get_bgp_nexthop_info(rn);
if (!bnc)
continue;
bgp_show_nexthop(vty, bgp, rn, bnc, false);
}
RB_FOREACH (bnc, bgp_nexthop_cache_head, &(*tree)[afi])
bgp_show_nexthop(vty, bgp, bnc, false);
}
}

Expand All @@ -858,27 +887,21 @@ static int show_ip_bgp_nexthop_table(struct vty *vty, const char *name,

if (nhopip_str) {
struct prefix nhop;
struct bgp_table **table;
struct bgp_node *rn;
struct bgp_nexthop_cache_head (*tree)[AFI_MAX];
struct bgp_nexthop_cache *bnc;

if (!str2prefix(nhopip_str, &nhop)) {
vty_out(vty, "nexthop address is malformed\n");
return CMD_WARNING;
}
table = import_table ? \
bgp->import_check_table : bgp->nexthop_cache_table;
rn = bgp_node_lookup(table[family2afi(nhop.family)], &nhop);
if (!rn) {
vty_out(vty, "specified nexthop is not found\n");
return CMD_SUCCESS;
}
bnc = bgp_node_get_bgp_nexthop_info(rn);
tree = import_table ? \
&bgp->import_check_table : &bgp->nexthop_cache_table;
bnc = bnc_find(tree[family2afi(nhop.family)], &nhop, 0);
if (!bnc) {
vty_out(vty, "specified nexthop does not have entry\n");
return CMD_SUCCESS;
}
bgp_show_nexthop(vty, bgp, rn, bnc, true);
bgp_show_nexthop(vty, bgp, bnc, true);
} else
bgp_show_nexthops(vty, bgp, import_table);

Expand Down Expand Up @@ -965,12 +988,10 @@ void bgp_scan_init(struct bgp *bgp)
afi_t afi;

for (afi = AFI_IP; afi < AFI_MAX; afi++) {
bgp->nexthop_cache_table[afi] =
bgp_table_init(bgp, afi, SAFI_UNICAST);
RB_INIT(bgp_nexthop_cache_head, &bgp->nexthop_cache_table[afi]);
RB_INIT(bgp_nexthop_cache_head, &bgp->import_check_table[afi]);
bgp->connected_table[afi] = bgp_table_init(bgp, afi,
SAFI_UNICAST);
bgp->import_check_table[afi] =
bgp_table_init(bgp, afi, SAFI_UNICAST);
}
}

Expand All @@ -987,16 +1008,12 @@ void bgp_scan_finish(struct bgp *bgp)

for (afi = AFI_IP; afi < AFI_MAX; afi++) {
/* Only the current one needs to be reset. */
bgp_nexthop_cache_reset(bgp->nexthop_cache_table[afi]);
bgp_table_unlock(bgp->nexthop_cache_table[afi]);
bgp->nexthop_cache_table[afi] = NULL;
bgp_nexthop_cache_reset(&bgp->nexthop_cache_table[afi]);
bgp_nexthop_cache_reset(&bgp->import_check_table[afi]);

bgp->connected_table[afi]->route_table->cleanup =
bgp_connected_cleanup;
bgp_table_unlock(bgp->connected_table[afi]);
bgp->connected_table[afi] = NULL;

bgp_table_unlock(bgp->import_check_table[afi]);
bgp->import_check_table[afi] = NULL;
}
}
29 changes: 26 additions & 3 deletions bgpd/bgp_nexthop.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "if.h"
#include "queue.h"
#include "prefix.h"
#include "openbsd-tree.h"

#define NEXTHOP_FAMILY(nexthop_len) \
(((nexthop_len) == 4 || (nexthop_len) == 12 \
Expand All @@ -38,6 +39,9 @@

/* BGP nexthop cache value structure. */
struct bgp_nexthop_cache {
/* RB-tree entry. */
RB_ENTRY(bgp_nexthop_cache) entry;

/* IGP route's metric. */
uint32_t metric;

Expand All @@ -61,12 +65,19 @@ struct bgp_nexthop_cache {
#define BGP_NEXTHOP_METRIC_CHANGED (1 << 1)
#define BGP_NEXTHOP_CONNECTED_CHANGED (1 << 2)

struct bgp_node *node;
/* Back pointer to the cache tree this entry belongs to. */
struct bgp_nexthop_cache_head *tree;

uint32_t srte_color;
struct prefix prefix;
void *nht_info; /* In BGP, peer session */
LIST_HEAD(path_list, bgp_path_info) paths;
unsigned int path_count;
struct bgp *bgp;
};
RB_HEAD(bgp_nexthop_cache_head, bgp_nexthop_cache);
RB_PROTOTYPE(bgp_nexthop_cache_head, bgp_nexthop_cache, entry,
bgp_nexthop_cache_compare);

/* Own tunnel-ip address structure */
struct tip_addr {
Expand All @@ -79,6 +90,12 @@ struct bgp_addrv6 {
struct list *ifp_name_list;
};

/* Forward declaration(s). */
struct peer;
struct update_subgroup;
struct bgp_node;
struct attr;

extern void bgp_connected_add(struct bgp *bgp, struct connected *c);
extern void bgp_connected_delete(struct bgp *bgp, struct connected *c);
extern bool bgp_subgrp_multiaccess_check_v4(struct in_addr nexthop,
Expand All @@ -94,10 +111,16 @@ extern int bgp_config_write_scan_time(struct vty *);
extern bool bgp_nexthop_self(struct bgp *bgp, afi_t afi, uint8_t type,
uint8_t sub_type, struct attr *attr,
struct bgp_node *rn);
extern struct bgp_nexthop_cache *bnc_new(void);
extern struct bgp_nexthop_cache *bnc_new(struct bgp_nexthop_cache_head *tree,
struct prefix *prefix,
uint32_t srte_color);
extern bool bnc_existing_for_prefix(struct bgp_nexthop_cache *bnc);
extern void bnc_free(struct bgp_nexthop_cache *bnc);
extern struct bgp_nexthop_cache *bnc_find(struct bgp_nexthop_cache_head *tree,
struct prefix *prefix,
uint32_t srte_color);
extern void bnc_nexthop_free(struct bgp_nexthop_cache *bnc);
extern char *bnc_str(struct bgp_nexthop_cache *bnc, char *buf, int size);
extern const char *bnc_str(struct bgp_nexthop_cache *bnc, char *buf, int size);
extern void bgp_scan_init(struct bgp *bgp);
extern void bgp_scan_finish(struct bgp *bgp);
extern void bgp_scan_vty_init(void);
Expand Down
Loading