On Sun, Jul 24, 2022 at 5:11 PM Waldek Kozaczuk <jwkozac...@gmail.com>
wrote:

> BTW there are more routecache related patches that I think we can bring in
> from Spirent fork which I documented here -
> https://github.com/cloudius-systems/osv/issues/1197.
> This one looks like a bug fix  -
> https://github.com/SpirentOrion/osv/commit/38df7da9fbe2f171297f41ecae58edc9bd436617
>

Yes, looks correct to me.


> This one more of an ehnancement -
> https://github.com/SpirentOrion/osv/commit/a20c112bf47a4a36b1fff17313f9d1b2e3ce919c
> .
>

This patch seems to suggest our cache was missing rt_gateway and it needs
it. But why didn't I ever notice this?
Unfortunately the patch doesn't say what kind of real-life scenario it was
trying to fix.


> I'm not sure this is the *best* way to tell these two cases apart, but I
>> probably agree it's a "good enough" way. As you can
>> see in the comments I wrote in routecache.hh (which I should have
>> copy-edited more carefully, I see they have a lot of
>> silly mistakes...), routecache.hh is all about the art of the "good
>> enough", so it makes sense to continue this.
>>
>
> In nutshell, this new version of the logic checks the device associated
> with the cached (present) route entry to determine what kind of match it
> should do - just netmask if non-loopback or
> more involved in a loopback one.
>

Yes, but consider for example that even on the real loopback (not an
optimization where the outside address is "converted" to loopback) you can
have 127.0.0.1 and 127.0.0.2
both on the same loopback. The new code will force it to use two different
routing table entries instead of one.

It's not a huge problem - most people never use multiple loopback
addresses. But someone who will use twenty of these addresses (I'm
sometimes doing this to run multiple servers on the same host for testing),
will suffer because the route cache only has room for 10 routes.

I'm tending to accept this patch, but I have a feeling that the "real" fix
would be something else. But this fix is probably "good enough".

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/CANEVyjsSGXAb%3DXrOL-XYx%3D21NHEHELFw-n2bsHxb%3DX-ULkwLZA%40mail.gmail.com.

Reply via email to