2014-03-16 19:24 GMT+08:00 FUJITA Tomonori <[email protected]>:
> On Tue, 11 Mar 2014 13:49:25 +0800
> Wei-Li Tang <[email protected]> wrote:
>
> > Openflow 1.1 and later versions allow the use of IP address with
> > arbitrary bitmask in match fields. This introduces new match fields
> > for arbitrary bitmask support in REST API.
>
> Something like the following doesn't work?
>
> The following can handle the currently supported format and also an
> ipv6 address arbitrary bitmask like:
>
> 'fe80::dead:beaf/ffff:0000:ffff:ffff:ffff:ffff:ffff:ffff'
>
>
> diff --git a/ryu/lib/ofctl_v1_3.py b/ryu/lib/ofctl_v1_3.py
> index 3e2713e..411f97f 100644
> --- a/ryu/lib/ofctl_v1_3.py
> +++ b/ryu/lib/ofctl_v1_3.py
> @@ -382,7 +382,13 @@ def to_match_ip(value):
>
>
> def to_match_ipv6(value):
> - ip = netaddr.IPNetwork(value)
> + try:
> + ip = netaddr.IPNetwork(value)
> + except netaddr.core.AddrFormatError:
> + if '/' in value:
> + addr, _, mask = value.partition('/')
> + return (netaddr.IPNetwork(addr).ip.words,
> + netaddr.IPNetwork(mask).ip.words)
> return ip.ip.words, ip.netmask.words
>
>
Your solution is more flexible, I shall adapt the patch later. Thanks a lot!
--
Sincerely,
Wei-Li Tang
System Engineer, Xinguard Inc.
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel