diff mbox series

[ovs-dev,01/10] ofp-actions: Make encap action really require OF1.3+.

Message ID 20190430232728.31093-1-blp@ovn.org
State Accepted
Commit 0cb2fe2f6e87bc1a3ca15d1a8ab9317fc2b6a9e6
Headers show
Series [ovs-dev,01/10] ofp-actions: Make encap action really require OF1.3+. | expand

Commit Message

Ben Pfaff April 30, 2019, 11:27 p.m. UTC
This action is only supported in OpenFlow 1.3 and later, but the parser
from text allowed it in earlier versions, which could cause confusion,
e.g.:

$ ovs-ofctl parse-flow 'actions=encap(ethernet())'
usable protocols: any
chosen protocol: OpenFlow10-table_id
2019-04-30T20:19:59Z|00001|ofp_actions|WARN|unknown OpenFlow10 action for vendor 0x2320 and type 46
2019-04-30T20:19:59Z|00002|ofp_actions|WARN|bad action at offset 0 (OFPBAC_BAD_VENDOR_TYPE):
00000000  ff ff 00 10 00 00 23 20-00 2e 00 00 00 00 00 00
OFPT_FLOW_MOD (xid=0x1): ***decode error: OFPBAC_BAD_VENDOR_TYPE***
00000000  01 0e 00 58 00 00 00 01-00 38 20 ff 00 00 00 00 |...X.....8 .....|
00000010  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
00000020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
00000030  00 00 00 00 00 00 00 00-00 00 00 00 00 00 80 00 |................|
00000040  ff ff ff ff ff ff 00 00-ff ff 00 10 00 00 23 20 |..............# |
00000050  00 2e 00 00 00 00 00 00-                        |........        |

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 lib/ofp-actions.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Numan Siddique June 8, 2019, 7:25 a.m. UTC | #1
On Wed, May 1, 2019 at 4:59 AM Ben Pfaff <blp@ovn.org> wrote:

> This action is only supported in OpenFlow 1.3 and later, but the parser
> from text allowed it in earlier versions, which could cause confusion,
> e.g.:
>
> $ ovs-ofctl parse-flow 'actions=encap(ethernet())'
> usable protocols: any
> chosen protocol: OpenFlow10-table_id
> 2019-04-30T20:19:59Z|00001|ofp_actions|WARN|unknown OpenFlow10 action for
> vendor 0x2320 and type 46
> 2019-04-30T20:19:59Z|00002|ofp_actions|WARN|bad action at offset 0
> (OFPBAC_BAD_VENDOR_TYPE):
> 00000000  ff ff 00 10 00 00 23 20-00 2e 00 00 00 00 00 00
> OFPT_FLOW_MOD (xid=0x1): ***decode error: OFPBAC_BAD_VENDOR_TYPE***
> 00000000  01 0e 00 58 00 00 00 01-00 38 20 ff 00 00 00 00 |...X.....8
> .....|
> 00000010  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
> |................|
> 00000020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
> |................|
> 00000030  00 00 00 00 00 00 00 00-00 00 00 00 00 00 80 00
> |................|
> 00000040  ff ff ff ff ff ff 00 00-ff ff 00 10 00 00 23 20 |..............#
> |
> 00000050  00 2e 00 00 00 00 00 00-                        |........
> |
>
> Signed-off-by: Ben Pfaff <blp@ovn.org>
>

Acked-by: Numan Siddique <nusiddiq@redhat.com> for the patches - 1 to 8 of
this series.

Looks like the patch 10 has some conflicts with the master.

Thanks
Numan


> ---
>  lib/ofp-actions.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
> index 1a24063d087c..182277da85cb 100644
> --- a/lib/ofp-actions.c
> +++ b/lib/ofp-actions.c
> @@ -4430,6 +4430,8 @@ parse_ed_props(const uint16_t prop_class, char
> **arg, int *n_props, struct ofpbu
>  static char * OVS_WARN_UNUSED_RESULT
>  parse_ENCAP(char *arg, const struct ofpact_parse_params *pp)
>  {
> +    *pp->usable_protocols &= OFPUTIL_P_OF13_UP;
> +
>      struct ofpact_encap *encap;
>      char *key, *value, *str;
>      char *error = NULL;
> --
> 2.20.1
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
Ben Pfaff June 9, 2019, 11:22 p.m. UTC | #2
On Sat, Jun 08, 2019 at 12:55:18PM +0530, Numan Siddique wrote:
> On Wed, May 1, 2019 at 4:59 AM Ben Pfaff <blp@ovn.org> wrote:
> 
> > This action is only supported in OpenFlow 1.3 and later, but the parser
> > from text allowed it in earlier versions, which could cause confusion,
> > e.g.:
> >
> > $ ovs-ofctl parse-flow 'actions=encap(ethernet())'
> > usable protocols: any
> > chosen protocol: OpenFlow10-table_id
> > 2019-04-30T20:19:59Z|00001|ofp_actions|WARN|unknown OpenFlow10 action for
> > vendor 0x2320 and type 46
> > 2019-04-30T20:19:59Z|00002|ofp_actions|WARN|bad action at offset 0
> > (OFPBAC_BAD_VENDOR_TYPE):
> > 00000000  ff ff 00 10 00 00 23 20-00 2e 00 00 00 00 00 00
> > OFPT_FLOW_MOD (xid=0x1): ***decode error: OFPBAC_BAD_VENDOR_TYPE***
> > 00000000  01 0e 00 58 00 00 00 01-00 38 20 ff 00 00 00 00 |...X.....8
> > .....|
> > 00000010  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
> > |................|
> > 00000020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
> > |................|
> > 00000030  00 00 00 00 00 00 00 00-00 00 00 00 00 00 80 00
> > |................|
> > 00000040  ff ff ff ff ff ff 00 00-ff ff 00 10 00 00 23 20 |..............#
> > |
> > 00000050  00 2e 00 00 00 00 00 00-                        |........
> > |
> >
> > Signed-off-by: Ben Pfaff <blp@ovn.org>
> >
> 
> Acked-by: Numan Siddique <nusiddiq@redhat.com> for the patches - 1 to 8 of
> this series.
> 
> Looks like the patch 10 has some conflicts with the master.

Thanks a lot.  I applied those patches to master.

I'll post a v2 for the remaining patches.
diff mbox series

Patch

diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
index 1a24063d087c..182277da85cb 100644
--- a/lib/ofp-actions.c
+++ b/lib/ofp-actions.c
@@ -4430,6 +4430,8 @@  parse_ed_props(const uint16_t prop_class, char **arg, int *n_props, struct ofpbu
 static char * OVS_WARN_UNUSED_RESULT
 parse_ENCAP(char *arg, const struct ofpact_parse_params *pp)
 {
+    *pp->usable_protocols &= OFPUTIL_P_OF13_UP;
+
     struct ofpact_encap *encap;
     char *key, *value, *str;
     char *error = NULL;