<div dir="ltr">Hi Renato,<div><br></div><div>find attached the patch with GNU style.</div><div><br></div><div>   ßingen.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 13, 2016 at 2:27 PM, Renato Westphal <span dir="ltr"><<a href="mailto:renato@opensourcerouting.org" target="_blank">renato@opensourcerouting.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Dec 12, 2016 at 11:18 AM, Bingen Eguzkitza <<a href="mailto:bingen@voltanet.io">bingen@voltanet.io</a>> wrote:<br>
> Adding Renato too, as he might be interested in.<br>
><br>
> On Mon, Dec 12, 2016 at 2:16 PM, Bingen Eguzkitza <<a href="mailto:bingen@voltanet.io">bingen@voltanet.io</a>><br>
> wrote:<br>
>><br>
>> Hi,<br>
>><br>
>> Fredi and Marc here found a bug that was causing Zebra to segfault. Find<br>
>> attached a patch for it.<br>
<br>
</span>I'm ok with this patch in the sense that it's an useful safeguard to have.<br>
<br>
But I can't see how this was causing a segfault to you.<br>
<br>
NHLFE entries are never removed directly. Instead of that, we always<br>
set the NHLFE_FLAG_DELETED flag and call lsp_processq_add(). Then the<br>
Quagga's workqueue guarantees that lsp_process() is called before<br>
lsp_processq_del(), which is where nhlfe_del() is called. With that<br>
said, it's impossible to have an invalid 'lsp->best_nhlfe' pointer in<br>
lsp_process().<br>
<br>
There's one other case where nhlfe_del() is called directly which is<br>
when the NHLFE_FLAG_INSTALLED flag is not set. But in this case the<br>
NHLFE entry will never be best NHLFE entry from the corresponding LSP.<br>
<br>
Finally, the lines introduced by your patch are not consistent in<br>
style with the rest of code (GNU style). Please resubmit a new version<br>
with this fixed.<br>
<span class="HOEnZb"><font color="#888888">--<br>
Renato Westphal<br>
</font></span></blockquote></div><br></div>