Re: [ovs-dev] [RFC net-next 5/7] selftests: openvswitch: Support implicit ipv6 arguments.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Simon Horman <horms@xxxxxxxxxx> writes:

> On Thu, Jun 13, 2024 at 02:13:31PM -0400, Aaron Conole wrote:
>> The current iteration of IPv6 support requires explicit fields to be set
>> in addition to not properly support the actual IPv6 addresses properly.
>> With this change, make it so that the ipv6() bare option is usable to
>> create wildcarded flows to match broad swaths of ipv6 traffic.
>> 
>> Signed-off-by: Aaron Conole <aconole@xxxxxxxxxx>
>> ---
>>  .../selftests/net/openvswitch/ovs-dpctl.py    | 43 ++++++++++++-------
>>  1 file changed, 28 insertions(+), 15 deletions(-)
>> 
>> diff --git a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py
>> index 5545e5cab1d6..2577a06c58cf 100644
>> --- a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py
>> +++ b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py
>> @@ -200,6 +200,19 @@ def convert_ipv4(data):
>>  
>>      return int(ipaddress.IPv4Address(ip)), int(ipaddress.IPv4Address(mask))
>>  
>> +def convert_ipv6(data):
>> +    ip, _, mask = data.partition('/')
>> +
>> +    if not ip:
>> +        ip = mask = 0
>> +    elif not mask:
>> +        mask = 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'
>> +    elif mask.isdigit():
>> +        mask = ipaddress.IPv6Network("::/" + mask).hostmask
>> +
>> +    return ipaddress.IPv6Address(ip).packed, ipaddress.IPv6Address(mask).packed
>> +
>> +
>
> nit: Perhaps one blank line is enough

Sure - dropped.

>>  def convert_int(size):
>>      def convert_int_sized(data):
>>          value, _, mask = data.partition('/')
>
> ...
>
> The nit above notwithstanding, this patch looks good to me.
>
> Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
> Tested-by: Simon Horman <horms@xxxxxxxxxx>





[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux