You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the NIC Update API doesn't enforce that the networks supplied to transit_ips are actually valid unicast addresses.
For example, I am able to update the NIC to use IPs from the loopback range (127.0.0.0/8) and multicast range (224.0.0.0/4), which I would expect to return an error:
In the above example, 100.64.0.0/10 and 100.64.0.10/10 both represent the same network, 100.64.0.0/10, but occupy two elements in the transit_ips array.
It's not possible to tell from the outside whether this configuration might cause errors, whether these values are flattened internally into a single functional element, or how these will be handled by OPTE.
The text was updated successfully, but these errors were encountered:
Pulling on the thread a little to establish what does happen today, when the CIDRs are being converted from nexus API types into OPTE's we clear any bits outside of the netmask to guarantee they are well-formed. So something misspecified like 192.168.0.255/24 would be converted to 192.168.0.0/24. Not ideal, but the rule functions -- this would however cause problems if we could add and remove them from NICs on live instances and then fail to remove an element because it's actually different in the installed rules.
I agree on the error cases you've outlined above, they shouldn't be too hard to impose on the external API. We might also prohibit overlapping blocks?
This PR adds in some checks when setting transit IPs on a NIC to ensure
that we have:
* Only unicast addresses.
* No loopback addresses.
* No duplicates.
As discussed in the ticket, violation of any of these isn't going to
leave OPTE or CRDB in a broken state -- just a confusing one for end
users.
Closes#7530.
It seems that the NIC Update API doesn't enforce that the networks supplied to
transit_ips
are actually valid unicast addresses.For example, I am able to update the NIC to use IPs from the loopback range (
127.0.0.0/8
) and multicast range (224.0.0.0/4
), which I would expect to return an error:Another, more pedantic, complaint is that we do not enforce each element of
transit_ips
is the network address (all host bits are set to 0):In the above example,
100.64.0.0/10
and100.64.0.10/10
both represent the same network,100.64.0.0/10
, but occupy two elements in thetransit_ips
array.It's not possible to tell from the outside whether this configuration might cause errors, whether these values are flattened internally into a single functional element, or how these will be handled by OPTE.
The text was updated successfully, but these errors were encountered: