From: Adrian Moreno <amore...@redhat.com> The match keyword "igmp" is not supported in ofp-parse, which means that flow dumps cannot be restored. Previously a workaround was added to ovs-save to avoid changing output in stable branches.
This patch removes that work around, and instead prints the igmp match in the accepted format (ip,nw_proto=2). Tests are added, and NEWS is updated to reflect this change. Signed-off-by: Adrian Moreno <amore...@redhat.com> Signed-off-by: Salvatore Daniele <sdani...@redhat.com> Co-authored-by: Salvatore Daniele <sdani...@redhat.com> Acked-by: Flavio Leitner <f...@sysclose.org> --- NEWS | 2 ++ lib/match.c | 2 -- tests/ovs-ofctl.at | 6 ++++++ utilities/ovs-save | 3 +-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 75045b67d..3d63fd136 100644 --- a/NEWS +++ b/NEWS @@ -90,6 +90,8 @@ v2.16.0 - xx xxx xxxx space in order to resolve a number of issues with per-vport dispatch. * New vswitchd unixctl command `dpif-netlink/dispatch-mode` will return the current dispatch mode for each datapath. + - ovs-ofctl dump-flows no longer prints "igmp". Instead the flag + "ip,nw_proto=2" is used. v2.15.0 - 15 Feb 2021 diff --git a/lib/match.c b/lib/match.c index ba716579d..4a0778c30 100644 --- a/lib/match.c +++ b/lib/match.c @@ -1556,8 +1556,6 @@ match_format(const struct match *match, skip_proto = true; if (f->nw_proto == IPPROTO_ICMP) { ds_put_format(s, "%sicmp%s,", colors.value, colors.end); - } else if (f->nw_proto == IPPROTO_IGMP) { - ds_put_format(s, "%sigmp%s,", colors.value, colors.end); } else if (f->nw_proto == IPPROTO_TCP) { ds_put_format(s, "%stcp%s,", colors.value, colors.end); } else if (f->nw_proto == IPPROTO_UDP) { diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at index 604f15c2d..ea74dcc64 100644 --- a/tests/ovs-ofctl.at +++ b/tests/ovs-ofctl.at @@ -192,6 +192,7 @@ actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note ip,actions=set_field:10.4.3.77->ip_src,mod_nw_ecn:2 sctp actions=drop sctp actions=drop +ip,nw_proto=2 actions=drop in_port=0 actions=resubmit:0 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,ingress) @@ -226,6 +227,7 @@ OFPT_FLOW_MOD: ADD actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.0 OFPT_FLOW_MOD: ADD ip actions=mod_nw_src:10.4.3.77,load:0x2->NXM_NX_IP_ECN[] OFPT_FLOW_MOD: ADD sctp actions=drop OFPT_FLOW_MOD: ADD sctp actions=drop +OFPT_FLOW_MOD: ADD ip,nw_proto=2 actions=drop OFPT_FLOW_MOD: ADD in_port=0 actions=resubmit:0 OFPT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) OFPT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,ingress) @@ -257,6 +259,7 @@ udp,nw_src=192.168.0.3,tp_dst=53 actions=mod_nw_ecn:2,output:1 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note ip,actions=mod_nw_ttl:1,set_field:10.4.3.77->ip_src +ip,nw_proto=2 actions=drop sctp actions=drop sctp actions=drop in_port=0 actions=resubmit:0 @@ -277,6 +280,7 @@ OFPT_FLOW_MOD (OF1.1): ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=mod_nw_ecn:2 OFPT_FLOW_MOD (OF1.1): ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535 OFPT_FLOW_MOD (OF1.1): ADD actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00 OFPT_FLOW_MOD (OF1.1): ADD ip actions=mod_nw_ttl:1,mod_nw_src:10.4.3.77 +OFPT_FLOW_MOD (OF1.1): ADD ip,nw_proto=2 actions=drop OFPT_FLOW_MOD (OF1.1): ADD sctp actions=drop OFPT_FLOW_MOD (OF1.1): ADD sctp actions=drop OFPT_FLOW_MOD (OF1.1): ADD in_port=0 actions=resubmit:0 @@ -300,6 +304,7 @@ actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note ipv6,actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src sctp actions=set_field:3334->sctp_src sctp actions=set_field:4445->sctp_dst +ip,nw_proto=2 actions=drop tcp actions=mod_tp_dst:1234 udp actions=mod_tp_src:1111 ip actions=mod_nw_src:10.1.1.2,mod_nw_dst:192.168.10.1,mod_nw_ttl:1,mod_nw_tos:16,mod_nw_ecn:2 @@ -326,6 +331,7 @@ OFPT_FLOW_MOD (OF1.2): ADD actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05 OFPT_FLOW_MOD (OF1.2): ADD ipv6 actions=set_field:fe80:123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src OFPT_FLOW_MOD (OF1.2): ADD sctp actions=set_field:3334->sctp_src OFPT_FLOW_MOD (OF1.2): ADD sctp actions=set_field:4445->sctp_dst +OFPT_FLOW_MOD (OF1.2): ADD ip,nw_proto=2 actions=drop OFPT_FLOW_MOD (OF1.2): ADD tcp actions=set_field:1234->tcp_dst OFPT_FLOW_MOD (OF1.2): ADD udp actions=set_field:1111->udp_src OFPT_FLOW_MOD (OF1.2): ADD ip actions=set_field:10.1.1.2->ip_src,set_field:192.168.10.1->ip_dst,mod_nw_ttl:1,set_field:4->ip_dscp,set_field:2->nw_ecn diff --git a/utilities/ovs-save b/utilities/ovs-save index 23cb0d9d9..27ce3a9aa 100755 --- a/utilities/ovs-save +++ b/utilities/ovs-save @@ -150,8 +150,7 @@ save_flows () { ovs-ofctl -O $ofp_version dump-flows --no-names --no-stats "$bridge" | \ sed -e '/NXST_FLOW/d' \ -e '/OFPST_FLOW/d' \ - -e 's/\(idle\|hard\)_age=[^,]*,//g' \ - -e 's/igmp/ip,nw_proto=2/g' > \ + -e 's/\(idle\|hard\)_age=[^,]*,//g' > \ "$workdir/$bridge.flows.dump" done echo "rm -rf \"$workdir\"" -- 2.31.1 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev