<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Aptos;
        panose-1:2 11 0 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:12.0pt;
        font-family:"Aptos",sans-serif;
        mso-ligatures:standardcontextual;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Aptos",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#467886" vlink="#96607D" style="word-wrap:break-word"><div dir="auto">Hello Marcin,<br><br>this looks interesting, would you please elaborate on the intended usecase? Is that something like "the hardware goes crazy with too many next hops"?<br><br>I'm wondering whether this is a direct intended use, or some crazy workaround which could be done completely differently if BIRD had the right tooling for your use case.<br><br>Thanks,<br>Maria<br></div><br><br><div class="gmail_quote"><div dir="auto">On March 7, 2025 2:53:37 PM GMT+01:00, "Saklak, Marcin via Bird-users" <bird-users@network.cz> wrote:</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div class="WordSection1">
<p class="MsoNormal">Hi All,<br>
I’m wondering if it’s possible to add a log entry whenever the merged path limit is exceeded.
<br>
For example, a route can have 64 next hops, but BIRD export to the kernel up to merge limit and skip rest of next hops.<br>
I’d like to be able to detect when this happens.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Below is a potential solution for that:<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><br>
</span><span style="font-size:10.0pt;font-family:"Courier New"">---<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">nest/rt-attr.c | 2 ++<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">1 file changed, 2 insertions(+)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">diff --git a/nest/rt-attr.c b/nest/rt-attr.c<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">index c8ef8e08..ef118cb0 100644<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">--- a/nest/rt-attr.c<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">+++ b/nest/rt-attr.c<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">@@ -323,6 +323,8 @@ nexthop_merge(struct nexthop *x, struct nexthop *y, int rx, int ry, int max, lin<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">     n = &((*n)->next);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">   }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">   *n = NULL;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">+  if (max == -1)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">+    log(L_ERR "Exceeded merge paths on limit!");<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">   return root;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">--<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">2.34.1</span><span style="font-size:11.0pt"><br>
<br>
</span>If you have any suggestions or a better approach, please let me know!<br>
<br>
Best regards,<br>
Marcin Sakłak<span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
</blockquote></div><div dir="auto"><div class='k9mail-signature'>-- <br>Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.</div></div></body>
</html>