(flow->dl_type == htons(ETH_TYPE_RARP))) {
memset(&wc->masks.nw_src, 0xff, sizeof wc->masks.nw_src);
memset(&wc->masks.nw_dst, 0xff, sizeof wc->masks.nw_dst);
+ } else if (eth_type_mpls(flow->dl_type)) {
+ memset(&wc->masks.mpls_lse, 0xff, sizeof wc->masks.mpls_lse);
}
if (flow->dl_type == htons(ETH_TYPE_ARP) ||
void
match_init_exact(struct match *match, const struct flow *flow)
{
- ovs_be64 tun_id = flow->tunnel.tun_id;
-
match->flow = *flow;
match->flow.skb_priority = 0;
match->flow.skb_mark = 0;
- memset(&match->flow.tunnel, 0, sizeof match->flow.tunnel);
- match->flow.tunnel.tun_id = tun_id;
flow_wildcards_init_exact(&match->wc);
}
}
}
-static void
-flow_format_mpls(const struct flow *flow, struct ds *s)
-{
- if (flow->dl_type == htons(ETH_TYPE_MPLS)) {
- ds_put_cstr(s, "mpls");
- } else if (flow->dl_type == htons(ETH_TYPE_MPLS_MCAST)) {
- ds_put_cstr(s, "mplsm");
- } else {
- return;
- }
-
- ds_put_format(s, "(label:%"PRIu32",tc:%d,ttl:%d,bos:%d),",
- mpls_lse_to_label(flow->mpls_lse),
- mpls_lse_to_tc(flow->mpls_lse),
- mpls_lse_to_ttl(flow->mpls_lse),
- mpls_lse_to_bos(flow->mpls_lse));
-}
-
/* Appends a string representation of 'match' to 's'. If 'priority' is
* different from OFP_DEFAULT_PRIORITY, includes it in 's'. */
void
int i;
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 19);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 20);
if (priority != OFP_DEFAULT_PRIORITY) {
ds_put_format(s, "priority=%u,", priority);
ds_put_cstr(s, "arp,");
} else if (f->dl_type == htons(ETH_TYPE_RARP)) {
ds_put_cstr(s, "rarp,");
- } else if (f->mpls_depth) {
- flow_format_mpls(f, s);
+ } else if (f->dl_type == htons(ETH_TYPE_MPLS)) {
+ ds_put_cstr(s, "mpls,");
+ } else if (f->dl_type == htons(ETH_TYPE_MPLS_MCAST)) {
+ ds_put_cstr(s, "mplsm,");
} else {
skip_type = false;
}
ds_put_format(s, "mpls_tc=%"PRIu8",",
mpls_lse_to_tc(f->mpls_lse));
}
+ if (wc->masks.mpls_lse & htonl(MPLS_TTL_MASK)) {
+ ds_put_format(s, "mpls_ttl=%"PRIu8",",
+ mpls_lse_to_ttl(f->mpls_lse));
+ }
if (wc->masks.mpls_lse & htonl(MPLS_BOS_MASK)) {
ds_put_format(s, "mpls_bos=%"PRIu8",",
mpls_lse_to_bos(f->mpls_lse));
&wc->masks.nd_target);
format_eth_masked(s, "nd_sll", f->arp_sha, wc->masks.arp_sha);
format_eth_masked(s, "nd_tll", f->arp_tha, wc->masks.arp_tha);
- } else if (f->nw_proto == IPPROTO_TCP ||
- f->nw_proto == IPPROTO_UDP) {
+ } else {
format_be16_masked(s, "tp_src", f->tp_src, wc->masks.tp_src);
format_be16_masked(s, "tp_dst", f->tp_dst, wc->masks.tp_dst);
}