-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
lib, zebra: Ensure route encoding has enough space #4435
Conversation
I'm going to put this into 6 and 7 and 7.1 dev once approved |
7c1e168
to
d215f62
Compare
💚 Basic BGPD CI results: SUCCESS, 0 tests failedResults table
For details, please contact louberger |
When you have compiled FRR with a large multipath number then encoding large ecmp routes between zebra and the routing daemons. There exists a theoritical size of multipath that will cause the encoding to be larger than the ZEBRA_MAX_PACKET_SIZ. In the cases where we have allocated streams that will encode routes then let's ensure that whatever size we have will auto-fit what we say we can send. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
d215f62
to
f3f4562
Compare
💚 Basic BGPD CI results: SUCCESS, 0 tests failedResults table
For details, please contact louberger |
Continuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-7904/ This is a comment from an automated CI system. CLANG Static Analyzer Summary
No Changes in Static Analysis warnings compared to base11 Static Analyzer issues remaining.See details at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch ...
but I'm a bit concerned about having to repeat the correct comparison/max expression. couldn't you do something like:
#define ZEBRA_MAX_PACKET_SIZ MAX(16384U, sizeof(struct zapi_route))
that'd put the operation in just one place?
so for a long time I've been ruminating about revamping the stream allocation sizes across the board. Which is why I tried to point fix this as much as possible. This is especially true when we have a bunch of data to pass back and forth between daemons. We have poorly sized buffers and we end up with a large amount of memory allocated and stored waiting to be sent. |
I'm fine with the change - just wanted to ask the question |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, understand the issue better now!
When you have compiled FRR with a large multipath number
then encoding large ecmp routes between zebra and the
routing daemons. There exists a theoritical size
of multipath that will cause the encoding to be larger
than the ZEBRA_MAX_PACKET_SIZ. In the cases where
we have allocated streams that will encode routes
then let's ensure that whatever size we have will
auto-fit what we say we can send.
Signed-off-by: Donald Sharp sharpd@cumulusnetworks.com