The above is as-is allowing the VM to use an IPv6 it does not own to announce its own IPs but can likely be restricted further and does not prevent it from announcing a MAC address it does not own but this requires privileges inside the VM and these privileges are anyway enough to make many other DoS for the VM itself.
I think the patch I had attached to this bug report had a working fix for that using nd_target param in _add_flow method.
The code is mostly:
self._add_flow( ovs_consts. BASE_EGRESS_ TABLE, port=port. ofport, port=port. ofport, type=lib_ const.ETHERTYPE _IPV6, proto=lib_ const.PROTO_ NUM_IPV6_ ICMP, type=n_ const.ICMPV6_ TYPE_NA, target= allowed_ ip_addr, 'resubmit( ,%d)' % (
ovs_consts. ACCEPTED_ EGRESS_ TRAFFIC_ NORMAL_ TABLE)
table=
priority=95,
in_
reg_
dl_
nw_
icmp_
nd_
actions=
)
and results in the following Open vSwitch rule:
table=71, hard_age=65534, priority= 95,icmp6, reg5=0x4, in_port= 4,icmp_ type=136, nd_target= fe80::f816: 3eff:fed3: 1eb4,actions= resubmit( ,94)
The above is as-is allowing the VM to use an IPv6 it does not own to announce its own IPs but can likely be restricted further and does not prevent it from announcing a MAC address it does not own but this requires privileges inside the VM and these privileges are anyway enough to make many other DoS for the VM itself.