The Key.equal function, added in #188, was not precise enough and was
collapsing keys with different default values. This would happen in
https://github.com/mirage/mirage/blob/3.7/lib/mirage_impl_network.ml#L36-L46
where every netif driver will use a key with the same name (e.g. "interface")
but with a different default value (e.g. "tap0" or "service").
We were lucky enough that the polymorphic hash function would work most of the
time and put these devices in different hashtbl buckets (and so equal would work
fine). When this is not the case, the devices are put in the same buckets and
one of them disapears and cause mirage#1157
Another possible fix is to use a unique ID for each key instead. That would work
too but that would make sharing more complicated.
Fix https://github.com/mirage/mirage/issues/1157
The issue is present since MirageOS 3.0.3 and was introduced by https://github.com/mirage/functoria/pull/188
The Key.equal function, added in #188, was not precise enough and was collapsing keys with different default values. This would happen in https://github.com/mirage/mirage/blob/3.7/lib/mirage_impl_network.ml#L36-L46 where every netif driver will use a key with the same name (e.g. "interface") but with a different default value (e.g. "tap0" or "service").
We were lucky enough that the polymorphic hash function would work most of the time and put these devices in different hashtbl buckets (and so equal would work fine). When this is not the case, the devices are put in the same buckets and one of them disapears and cause mirage#1157
Another possible fix is to use a unique ID for each key instead. That would work too but that would make sharing more complicated.