match_set_tun_ipv6_dst(match, &flower->key.tunnel.ipv6.ipv6_dst);
}
if (flower->key.tunnel.tos) {
- match_set_tun_tos(match, flower->key.tunnel.tos);
+ match_set_tun_tos_masked(match, flower->key.tunnel.tos,
+ flower->mask.tunnel.tos);
}
if (flower->key.tunnel.ttl) {
- match_set_tun_ttl(match, flower->key.tunnel.ttl);
+ match_set_tun_ttl_masked(match, flower->key.tunnel.ttl,
+ flower->mask.tunnel.ttl);
}
if (flower->key.tunnel.tp_dst) {
match_set_tun_tp_dst(match, flower->key.tunnel.tp_dst);
const struct flow *key = &match->flow;
struct flow *mask = &match->wc.masks;
const struct flow_tnl *tnl = &match->flow.tunnel;
+ const struct flow_tnl *tnl_mask = &mask->tunnel;
struct tc_action *action;
uint32_t block_id = 0;
struct nlattr *nla;
flower.key.tunnel.ttl = tnl->ip_ttl;
flower.key.tunnel.tp_src = tnl->tp_src;
flower.key.tunnel.tp_dst = tnl->tp_dst;
+ flower.mask.tunnel.tos = tnl_mask->ip_tos;
+ flower.mask.tunnel.ttl = tnl_mask->ip_ttl;
flower.tunnel = true;
}
memset(&mask->tunnel, 0, sizeof mask->tunnel);
flower->key.tunnel.tp_dst =
nl_attr_get_be16(attrs[TCA_FLOWER_KEY_ENC_UDP_DST_PORT]);
}
- if (attrs[TCA_FLOWER_KEY_ENC_IP_TOS]) {
+ if (attrs[TCA_FLOWER_KEY_ENC_IP_TOS_MASK]) {
flower->key.tunnel.tos =
nl_attr_get_u8(attrs[TCA_FLOWER_KEY_ENC_IP_TOS]);
+ flower->mask.tunnel.tos =
+ nl_attr_get_u8(attrs[TCA_FLOWER_KEY_ENC_IP_TOS_MASK]);
}
- if (attrs[TCA_FLOWER_KEY_ENC_IP_TTL]) {
+ if (attrs[TCA_FLOWER_KEY_ENC_IP_TTL_MASK]) {
flower->key.tunnel.ttl =
nl_attr_get_u8(attrs[TCA_FLOWER_KEY_ENC_IP_TTL]);
+ flower->mask.tunnel.ttl =
+ nl_attr_get_u8(attrs[TCA_FLOWER_KEY_ENC_IP_TTL_MASK]);
}
}
ovs_be32 id = be64_to_be32(flower->key.tunnel.id);
uint8_t tos = flower->key.tunnel.tos;
uint8_t ttl = flower->key.tunnel.ttl;
+ uint8_t tos_mask = flower->mask.tunnel.tos;
+ uint8_t ttl_mask = flower->mask.tunnel.ttl;
if (ipv4_dst) {
nl_msg_put_be32(request, TCA_FLOWER_KEY_ENC_IPV4_SRC, ipv4_src);
nl_msg_put_in6_addr(request, TCA_FLOWER_KEY_ENC_IPV6_SRC, ipv6_src);
nl_msg_put_in6_addr(request, TCA_FLOWER_KEY_ENC_IPV6_DST, ipv6_dst);
}
- if (tos) {
+ if (tos_mask) {
nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TOS, tos);
+ nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TOS_MASK, tos_mask);
}
- if (ttl) {
+ if (ttl_mask) {
nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TTL, ttl);
+ nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TTL_MASK, ttl_mask);
}
nl_msg_put_be16(request, TCA_FLOWER_KEY_ENC_UDP_DST_PORT, tp_dst);
nl_msg_put_be32(request, TCA_FLOWER_KEY_ENC_KEY_ID, id);