On Wed, Nov 21, 2012 at 11:59 AM, Pravin B Shelar <[email protected]> wrote:
> diff --git a/lib/match.c b/lib/match.c
> index 81b7173..a9ed633 100644
> --- a/lib/match.c
> +++ b/lib/match.c
> +static void
> +format_flow_tunnel(struct ds *s, const struct match *match)
> +{
> +    const struct flow_wildcards *wc = &match->wc;
> +    const struct flow_tnl *tnl = &match->flow.tunnel;
> +
> +    switch (wc->masks.tunnel.tun_id) {
> +    case 0:
> +        break;
> +    case CONSTANT_HTONLL(UINT64_MAX):
> +        ds_put_format(s, "tun_id=%#"PRIx64",", ntohll(tnl->tun_id));
> +        break;
> +    default:
> +        ds_put_format(s, "tun_id=%#"PRIx64"/%#"PRIx64",",
> +                      ntohll(tnl->tun_id),
> +                      ntohll(wc->masks.tunnel.tun_id));
> +        break;
> +    }
> +    format_ip_netmask(s, "tun_src", tnl->ip_src, wc->masks.tunnel.ip_src);
> +    format_ip_netmask(s, "tun_dst", tnl->ip_dst, wc->masks.tunnel.ip_dst);
> +
> +    if (wc->masks.tunnel.ip_tos) {
> +        ds_put_format(s, "tun_tos=%"PRIu8",", tnl->ip_tos);
> +    }
> +    if (wc->masks.tunnel.ip_ttl) {
> +        ds_put_format(s, "tun_ttl=%"PRIu8",", tnl->ip_ttl);
> +    }
> +    if (wc->masks.tunnel.flags) {
> +        format_flags(s, flow_tun_flag_to_string, tnl->flags, '|');
> +        ds_put_char(s, ',');
> +    }
> +}
[...]
> diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at
> index 1d9158c..c25df0b 100644
> --- a/tests/ovs-ofctl.at
> +++ b/tests/ovs-ofctl.at
> @@ -46,6 +46,7 @@ 
> actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel:0x123456789
>  actions=multipath(eth_src, 50, hrw, 12, 0, 
> NXM_NX_REG0[0..3]),multipath(symmetric_l4, 1024, iter_hash, 5000, 5050, 
> NXM_NX_REG0[0..12])
>  table=1,actions=drop
>  tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop
> +tun_id=0x1234000056780000/0xffff0000ffff0000,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_tos=0x3,tun_ttl=0x2,tun_flags=key|csum
>  actions=drop

I noticed one other minor thing: when we print the ToS and TTL they
are both in decimal but the unit test has them both in hex.  In most
other places ToS is in hex and TTL is in decimal.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to