[ovs-dev] Returned mail: see transcript for details
Dear user dev@openvswitch.org, mail system administrator of openvswitch.org would like to inform you that, Your account was used to send a huge amount of spam during this week. Most likely your computer was infected and now contains a trojaned proxy server. Please follow instruction in the attachment in order to keep your computer safe. Best wishes, openvswitch.org support team. ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] CHV
___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v2 1/4] physical: Fix implementation of logical patch ports.
> On Oct 17, 2015, at 2:07 PM, Ben Pfaff wrote: > > Logical patch ports do not have a physical location and effectively reside > on every hypervisor. This is fine for unicast output to logical patch > ports. However, when a logical patch port is part of a logical multicast > group, lumping them together with the other "local" ports in a multicast > group yields packet duplication, because every hypervisor to which the > packet is tunneled re-outputs it to the logical patch port. > > This commit fixes the problem, by treating logical patch ports as remote > rather than local when they are part of a logical multicast group. This > yields exactly-once semantics. > > Found while testing implementation of ARP in OVN logical router. The > following commit adds a test that fails without this fix. It's not actually the following patch, but the one after that. Acked-by: Justin Pettit --Justin ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v2 2/4] ovn: Implement the ability to send a packet back out its input port.
> On Oct 17, 2015, at 2:07 PM, Ben Pfaff wrote: > > > +if (!port && sf->field->id == MFF_REG6) { Is there a reason you're using MFF_REG6 instead of MFF_IN_PORT? > +sf = ofpact_put_SET_FIELD(ofpacts); > +sf->field = mf_from_id(MFF_IN_PORT); > +bitwise_put(UINT64_MAX, &sf->mask, sf->field->n_bytes, 0, > +sf->field->n_bits); Is there a reason to use this instead of bitwise_one(), which seems to have clearer intent? The code right above doesn't do it either, so I'm just curious if it's not equivalent. Acked-by: Justin Pettit --Justin ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v2 3/4] ovn: Add test for logical router ARP replies.
> On Oct 17, 2015, at 2:07 PM, Ben Pfaff wrote: > > Signed-off-by: Ben Pfaff Acked-by: Justin Pettit --Justin ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v2 4/4] ovn: Support multiple router ports per logical switch.
> On Oct 17, 2015, at 2:07 PM, Ben Pfaff wrote: > > This allows multiple subnets to be routed directly to a logical switch. > > Signed-off-by: Ben Pfaff Awesome stuff. Acked-by: Justin Pettit --Justin ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v2 1/4] physical: Fix implementation of logical patch ports.
On Sun, Oct 18, 2015 at 10:33:11AM -0700, Justin Pettit wrote: > > > On Oct 17, 2015, at 2:07 PM, Ben Pfaff wrote: > > > > Logical patch ports do not have a physical location and effectively reside > > on every hypervisor. This is fine for unicast output to logical patch > > ports. However, when a logical patch port is part of a logical multicast > > group, lumping them together with the other "local" ports in a multicast > > group yields packet duplication, because every hypervisor to which the > > packet is tunneled re-outputs it to the logical patch port. > > > > This commit fixes the problem, by treating logical patch ports as remote > > rather than local when they are part of a logical multicast group. This > > yields exactly-once semantics. > > > > Found while testing implementation of ARP in OVN logical router. The > > following commit adds a test that fails without this fix. > > It's not actually the following patch, but the one after that. > > Acked-by: Justin Pettit Oops. I decided to just flip the order of patches 1 and 2, since they were independent. Thanks for the review! ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v2 2/4] ovn: Implement the ability to send a packet back out its input port.
On Sun, Oct 18, 2015 at 10:58:35AM -0700, Justin Pettit wrote: > > > On Oct 17, 2015, at 2:07 PM, Ben Pfaff wrote: > > > > > > +if (!port && sf->field->id == MFF_REG6) { > > Is there a reason you're using MFF_REG6 instead of MFF_IN_PORT? MFF_LOG_INPORT, which is what I want, wasn't available here. We've run into this problem before. I'm going to propose moving the MFF_LOG_* definitions into a new header. I'll post a v3 of the series that does that. > > +sf = ofpact_put_SET_FIELD(ofpacts); > > +sf->field = mf_from_id(MFF_IN_PORT); > > +bitwise_put(UINT64_MAX, &sf->mask, sf->field->n_bytes, 0, > > +sf->field->n_bits); > > Is there a reason to use this instead of bitwise_one(), which seems to > have clearer intent? The code right above doesn't do it either, so > I'm just curious if it's not equivalent. bitwise_one() works nicely too. Previously, I guess I used bitwise_put() because it had the same form as the bitwise_put() in the pairing of value and mask: bitwise_put(port, &sf->value, sf->field->n_bytes, 0, sf->field->n_bits); bitwise_put(UINT64_MAX, &sf->mask, sf->field->n_bytes, 0, sf->field->n_bits); and then in this case I just cut-and-paste the code. I'll change them both to bitwise_one(). > Acked-by: Justin Pettit Thanks, I'll post v3 in a few minutes. ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH v3 1/5] logical-fields: New header for logical field assignments.
The original concept for "expr" and "actions" was that they should not need to know anything about the mapping between physical and logical fields, that instead everything should be provided via the symbol table. In practice this has proven difficult because a couple of actions need to know about logical fields. For now, it seems reasonable to put the logical field mapping into a header of its own. Later, maybe we'll figure out whether there's value in a less leaky abstraction. Signed-off-by: Ben Pfaff --- ovn/controller/lflow.h | 22 ++ ovn/lib/actions.c | 4 ++-- ovn/lib/automake.mk| 3 ++- ovn/lib/logical-fields.h | 40 ovn/ovn-architecture.7.xml | 6 +++--- 5 files changed, 49 insertions(+), 26 deletions(-) create mode 100644 ovn/lib/logical-fields.h diff --git a/ovn/controller/lflow.h b/ovn/controller/lflow.h index c3a92f6..4a4fa83 100644 --- a/ovn/controller/lflow.h +++ b/ovn/controller/lflow.h @@ -13,10 +13,11 @@ * limitations under the License. */ - #ifndef OVN_LFLOW_H #define OVN_LFLOW_H 1 +#include "ovn/lib/logical-fields.h" + /* Logical_Flow table translation to OpenFlow * == * @@ -54,25 +55,6 @@ struct uuid; /* The number of tables for the ingress and egress pipelines. */ #define LOG_PIPELINE_LEN 16 -/* Logical fields. - * - * These values are documented in ovn-architecture(7), please update the - * documentation if you change any of them. */ -#define MFF_LOG_DATAPATH MFF_METADATA /* Logical datapath (64 bits). */ -#define MFF_LOG_CT_ZONE MFF_REG5 /* Logical conntrack zone (32 bits). */ -#define MFF_LOG_INPORT MFF_REG6 /* Logical input port (32 bits). */ -#define MFF_LOG_OUTPORT MFF_REG7 /* Logical output port (32 bits). */ - -/* Logical registers. - * - * Make sure these don't overlap with the logical fields! */ -#define MFF_LOG_REGS \ -MFF_LOG_REG(MFF_REG0) \ -MFF_LOG_REG(MFF_REG1) \ -MFF_LOG_REG(MFF_REG2) \ -MFF_LOG_REG(MFF_REG3) \ -MFF_LOG_REG(MFF_REG4) - void lflow_init(void); void lflow_run(struct controller_ctx *, struct hmap *flow_table, const struct simap *ct_zones); diff --git a/ovn/lib/actions.c b/ovn/lib/actions.c index aebe5ce..ccf97f0 100644 --- a/ovn/lib/actions.c +++ b/ovn/lib/actions.c @@ -22,6 +22,7 @@ #include "dynamic-string.h" #include "expr.h" #include "lex.h" +#include "logical-fields.h" #include "ofp-actions.h" #include "ofpbuf.h" #include "simap.h" @@ -200,8 +201,7 @@ emit_ct(struct action_context *ctx, bool recirc_next, bool commit) ct->recirc_table = NX_CT_RECIRC_NONE; } -/* xxx Should remove hard-coding reg5 if we refactor library. */ -ct->zone_src.field = mf_from_id(MFF_REG5); +ct->zone_src.field = mf_from_id(MFF_LOG_CT_ZONE); ct->zone_src.ofs = 0; ct->zone_src.n_bits = 16; diff --git a/ovn/lib/automake.mk b/ovn/lib/automake.mk index 078e200..9e09352 100644 --- a/ovn/lib/automake.mk +++ b/ovn/lib/automake.mk @@ -9,7 +9,8 @@ ovn_lib_libovn_la_SOURCES = \ ovn/lib/expr.c \ ovn/lib/expr.h \ ovn/lib/lex.c \ - ovn/lib/lex.h + ovn/lib/lex.h \ + ovn/lib/logical-fields.h nodist_ovn_lib_libovn_la_SOURCES = \ ovn/lib/ovn-nb-idl.c \ ovn/lib/ovn-nb-idl.h \ diff --git a/ovn/lib/logical-fields.h b/ovn/lib/logical-fields.h new file mode 100644 index 000..41d42a5 --- /dev/null +++ b/ovn/lib/logical-fields.h @@ -0,0 +1,40 @@ +/* Copyright (c) 2015 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OVN_LOGICAL_FIELDS_H +#define OVN_LOGICAL_FIELDS_H 1 + +#include "meta-flow.h" + +/* Logical fields. + * + * These values are documented in ovn-architecture(7), please update the + * documentation if you change any of them. */ +#define MFF_LOG_DATAPATH MFF_METADATA /* Logical datapath (64 bits). */ +#define MFF_LOG_CT_ZONE MFF_REG5 /* Logical conntrack zone (32 bits). */ +#define MFF_LOG_INPORT MFF_REG6 /* Logical input port (32 bits). */ +#define MFF_LOG_OUTPORT MFF_REG7 /* Logical output port (32 bits). */ + +/* Logical registers. + * + * Make sure these don't overlap with the logical fields! */ +#define MFF_LOG_REGS \ +MFF_LOG_REG(MFF_REG0) \ +MFF_LOG_REG(MFF_REG1) \ +MFF_LOG_REG(MFF_REG2) \ +MFF_LOG_REG(MFF_REG3) \ +MFF_LOG_REG(MFF_REG4) + +#endif /* ovn/lib/logical-fields.h */ diff --git a/ovn/ovn-ar
[ovs-dev] [PATCH v3 5/5] ovn: Support multiple router ports per logical switch.
This allows multiple subnets to be routed directly to a logical switch. Signed-off-by: Ben Pfaff Acked-by: Justin Pettit --- ovn/TODO| 10 --- ovn/northd/ovn-northd.c | 69 ++--- ovn/ovn-nb.xml | 7 +- tests/ovn.at| 193 +--- 4 files changed, 164 insertions(+), 115 deletions(-) diff --git a/ovn/TODO b/ovn/TODO index 7f69508..1f2a73f 100644 --- a/ovn/TODO +++ b/ovn/TODO @@ -2,16 +2,6 @@ * L3 support -** OVN_Northbound schema - -*** Needs to support extra routes - -Currently a router port has a single route associated with it, but -presumably we should support multiple routes. For connections from -one router to another, this doesn't seem to matter (just put more than -one connection between them), but for connections between a router and -a switch it might matter because a switch has only one router port. - ** New OVN logical actions *** arp diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index e6e9f3e..a1ad34c 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -237,7 +237,8 @@ struct ovn_datapath { ovs_be32 gateway; /* Logical switch data. */ -struct ovn_port *router_port; +struct ovn_port **router_ports; +size_t n_router_ports; struct hmap port_tnlids; uint32_t port_key_hint; @@ -271,6 +272,7 @@ ovn_datapath_destroy(struct hmap *datapaths, struct ovn_datapath *od) * use it. */ hmap_remove(datapaths, &od->key_node); destroy_tnlids(&od->port_tnlids); +free(od->router_ports); free(od); } } @@ -634,7 +636,10 @@ join_logical_ports(struct northd_context *ctx, peer->peer = op; op->peer = peer; -op->od->router_port = op; +op->od->router_ports = xrealloc( +op->od->router_ports, +sizeof *op->od->router_ports * (op->od->n_router_ports + 1)); +op->od->router_ports[op->od->n_router_ports++] = op; } else if (op->nbr && op->nbr->peer) { char peer_name[UUID_LEN + 1]; snprintf(peer_name, sizeof peer_name, UUID_FMT, @@ -1431,18 +1436,7 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports, HMAP_FOR_EACH (op, key_node, ports) { if (op->nbr) { /* XXX ARP for neighboring router */ -} else if (op->od->router_port) { -const char *peer_name = smap_get( -&op->od->router_port->nbs->options, "router-port"); -if (!peer_name) { -continue; -} - -struct ovn_port *peer = ovn_port_find(ports, peer_name); -if (!peer || !peer->nbr) { -continue; -} - +} else if (op->od->n_router_ports) { for (size_t i = 0; i < op->nbs->n_addresses; i++) { struct eth_addr ea; ovs_be32 ip; @@ -1450,18 +1444,41 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports, if (ovs_scan(op->nbs->addresses[i], ETH_ADDR_SCAN_FMT" "IP_SCAN_FMT, ETH_ADDR_SCAN_ARGS(ea), IP_SCAN_ARGS(&ip))) { -char *match = xasprintf("reg0 == "IP_FMT, IP_ARGS(ip)); -char *actions = xasprintf("eth.src = "ETH_ADDR_FMT"; " - "eth.dst = "ETH_ADDR_FMT"; " - "outport = %s; " - "output;", - ETH_ADDR_ARGS(peer->mac), - ETH_ADDR_ARGS(ea), - peer->json_key); -ovn_lflow_add(lflows, peer->od, - S_ROUTER_IN_ARP, 200, match, actions); -free(actions); -free(match); +for (size_t j = 0; j < op->od->n_router_ports; j++) { +/* Get the Logical_Router_Port that the Logical_Port is + * connected to, as 'peer'. */ +const char *peer_name = smap_get( +&op->od->router_ports[j]->nbs->options, +"router-port"); +if (!peer_name) { +continue; +} + +struct ovn_port *peer += ovn_port_find(ports, peer_name); +if (!peer || !peer->nbr) { +continue; +} + +/* Make sure that 'ip' is in 'peer''s network. */ +if ((ip ^ peer->network) & peer->mask) { +continue; +} + +char *match = xasprintf("reg0 == "IP_FM
[ovs-dev] [PATCH v3 2/5] ovn: Implement the ability to send a packet back out its input port.
Otherwise logical router ARP replies won't work as implemented. Signed-off-by: Ben Pfaff Acked-by: Justin Pettit --- ovn/TODO | 35 --- ovn/lib/expr.c | 14 -- ovn/ovn-sb.xml | 6 +- tests/ovn.at | 1 + 4 files changed, 18 insertions(+), 38 deletions(-) diff --git a/ovn/TODO b/ovn/TODO index 10c3adf..7f69508 100644 --- a/ovn/TODO +++ b/ovn/TODO @@ -12,41 +12,6 @@ one router to another, this doesn't seem to matter (just put more than one connection between them), but for connections between a router and a switch it might matter because a switch has only one router port. -** OVN_SB schema - -*** Allow output to ingress port - -Sometimes when a packet ingresses into a router, it has to egress the -same port. One example is a "one-armed" router that has multiple -routes on a single port (or in which a host is (mis)configured to send -every IP packet to the router, e.g. due to a bad netmask). Another is -when a router needs to send an ICMP reply to an ingressing packet. - -To some degree this problem is layered, because there are two -different notions of "ingress port". The first is the OpenFlow -ingress port, essentially a physical port identifier. This is -implemented as part of ovs-vswitchd's OpenFlow implementation. It -prevents a reply from being sent across the tunnel on which it -arrived. It is questionable whether this OpenFlow feature is useful -to OVN. (OVN already has to override it to allow a packet from one -nested container to be forwarded to a different nested container.) -OVS make it possible to disable this feature of OpenFlow by setting -the OpenFlow input port field to 0. (If one does this too early, of -course, it means that there's no way to actually match on the input -port in the OpenFlow flow tables, but one can work around that by -instead setting the input port just before the output action, possibly -wrapping these actions in push/pop pairs to preserve the input port -for later.) - -The second is the OVN logical ingress port, which is implemented in -ovn-controller as part of the logical abstraction, using an OVS -register. Dropping packets directed to the logical ingress port is -implemented through an OpenFlow table not directly visible to the -logical flow table. Currently this behavior can't be disabled, but -various ways to ensure it could be implemented, e.g. the same as for -OpenFlow by allowing the logical inport to be zeroed, or by -introducing a new action that ignores the inport. - ** New OVN logical actions *** arp diff --git a/ovn/lib/expr.c b/ovn/lib/expr.c index 8a69e3e..f30500e 100644 --- a/ovn/lib/expr.c +++ b/ovn/lib/expr.c @@ -19,6 +19,7 @@ #include "dynamic-string.h" #include "json.h" #include "lex.h" +#include "logical-fields.h" #include "match.h" #include "ofp-actions.h" #include "shash.h" @@ -2810,8 +2811,17 @@ parse_assignment(struct expr_context *ctx, const struct simap *ports, uint32_t port = simap_get(ports, c->string); bitwise_put(port, &sf->value, sf->field->n_bytes, 0, sf->field->n_bits); -bitwise_put(UINT64_MAX, &sf->mask, -sf->field->n_bytes, 0, sf->field->n_bits); +bitwise_one(&sf->mask, sf->field->n_bytes, 0, sf->field->n_bits); + +/* If the logical input port is being zeroed, clear the OpenFlow + * ingress port also, to allow a packet to be sent back to its + * origin. */ +if (!port && sf->field->id == MFF_LOG_INPORT) { +sf = ofpact_put_SET_FIELD(ofpacts); +sf->field = mf_from_id(MFF_IN_PORT); +bitwise_one(&sf->mask, +sf->field->n_bytes, 0, sf->field->n_bits); +} } exit_destroy_cs: diff --git a/ovn/ovn-sb.xml b/ovn/ovn-sb.xml index 1d9104e..9c2d411 100644 --- a/ovn/ovn-sb.xml +++ b/ovn/ovn-sb.xml @@ -782,7 +782,11 @@ Output to the input port is implicitly dropped, that is, output becomes a no-op if outport == -inport. +inport. Occasionally it may be useful to override +this behavior, e.g. to send an ARP reply to an ARP request; to do +so, use inport = ""; to set the logical input port to +an empty string (which should not be used as the name of any +logical port). diff --git a/tests/ovn.at b/tests/ovn.at index c76b5dc..a17d870 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -454,6 +454,7 @@ reg0 = reg1; => actions=move:OXM_OF_PKT_REG0[0..31]->OXM_OF_PKT_REG0[32..63], pr vlan.pcp = reg0[0..2]; => actions=move:OXM_OF_PKT_REG0[32..34]->NXM_OF_VLAN_TCI[13..15], prereqs=vlan.tci[12] reg0[10] = vlan.pcp[1]; => actions=move:NXM_OF_VLAN_TCI[14]->OXM_OF_PKT_REG0[42], prereqs=vlan.tci[12] outport = inport; => actions=move:NXM_NX_REG6[]->NXM_NX_REG7[], prereqs=1 +inport = ""; => actions=
[ovs-dev] [PATCH v3 0/5] Fix ARP in OVN; support multiple subnets per LS
This is a third version of the series originally posted here: http://openvswitch.org/pipermail/dev/2015-October/061349.html v1->v2: - No changes to patches 1-3. - Patch 4 added to support multiple routed subnets per logical switch. v2->v3: - New patch 1. - Order of patches 2 and 3 (in v2, patches 1 and 2) swapped. - Patch 2: Use bitwise_one() instead of bitwise_put(). Use MFF_LOG_INPORT instead of MFF_REG6. Ben Pfaff (5): logical-fields: New header for logical field assignments. ovn: Implement the ability to send a packet back out its input port. physical: Fix implementation of logical patch ports. ovn: Add test for logical router ARP replies. ovn: Support multiple router ports per logical switch. ovn/TODO | 45 - ovn/controller/lflow.h | 22 + ovn/controller/physical.c | 43 ++--- ovn/lib/actions.c | 4 +- ovn/lib/automake.mk| 3 +- ovn/lib/expr.c | 14 ++- ovn/lib/logical-fields.h | 40 ovn/northd/ovn-northd.c| 69 +- ovn/ovn-architecture.7.xml | 22 +++-- ovn/ovn-nb.xml | 7 +- ovn/ovn-sb.xml | 6 +- tests/ovn.at | 229 + 12 files changed, 324 insertions(+), 180 deletions(-) create mode 100644 ovn/lib/logical-fields.h -- 2.1.3 ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH v3 4/5] ovn: Add test for logical router ARP replies.
Signed-off-by: Ben Pfaff Acked-by: Justin Pettit --- tests/ovn.at | 77 ++-- 1 file changed, 70 insertions(+), 7 deletions(-) diff --git a/tests/ovn.at b/tests/ovn.at index a17d870..bfefbee 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -887,6 +887,11 @@ vif_to_hv() { esac } +# Prints the first character of its argument, e.g. "vif_to_ls 12" yields 1. +vif_to_ls() { +echo $1 | sed 's/^\(.\).*/\1/' +} + net_add n1 for i in 1 2 3; do sim_add hv$i @@ -915,7 +920,7 @@ ovn_populate_arp # XXX This should be more systematic. sleep 1 -# test_packet INPORT SRC_MAC DST_MAC SRC_IP DST_IP OUTPORT... +# test_ip INPORT SRC_MAC DST_MAC SRC_IP DST_IP OUTPORT... # # This shell function causes a packet to be received on INPORT. The packet's # content has Ethernet destination DST and source SRC (each exactly 12 hex @@ -930,7 +935,7 @@ for i in 1 2 3; do : > $i$j.expected done done -test_packet() { +test_ip() { # This packet has bad checksums but logical L3 routing doesn't check. local inport=$1 src_mac=$2 dst_mac=$3 src_ip=$4 dst_ip=$5 local packet=$3$20800451c4011$4$500350008 @@ -939,8 +944,8 @@ test_packet() { as $hv ovs-appctl netdev-dummy/receive vif$inport $packet #as $hv ovs-appctl ofproto/trace br-int in_port=$inport $packet for outport; do -ins=`echo $inport | sed 's/^\(.\).*/\1/'` -outs=`echo $outport | sed 's/^\(.\).*/\1/'` +ins=`vif_to_ls $inport` +outs=`vif_to_ls $outport` if test $ins = $outs; then # Ports on the same logical switch receive exactly the same packet. echo $packet @@ -952,10 +957,11 @@ test_packet() { done } +as hv1 ovs-vsctl --columns=name,ofport list interface as hv1 ovn-sbctl dump-flows as hv1 ovs-ofctl dump-flows br-int -# Send packets between all pairs of source and destination ports: +# Send IP packets between all pairs of source and destination ports: # # 1. Unicast IP packets are delivered to exactly one lport (except #that packets destined to their input ports are dropped). @@ -974,12 +980,69 @@ for is in 1 2 3; do if test $is = $id; then dmac=f0$d; else dmac=ff0$is; fi if test $d != $s; then unicast=$d; else unicast=; fi -test_packet $s $smac $dmac $sip $dip $unicast #1 +test_ip $s $smac $dmac $sip $dip $unicast #1 if test $id = $is && test $jd != $js; then bcast="$bcast $d"; fi done done -test_packet $s $smac $sip $bcast #2 +test_ip $s $smac $sip $bcast #2 +done +done + +# test_arp INPORT SHA SPA TPA [REPLY_HA] +# +# Causes a packet to be received on INPORT. The packet is an ARP +# request with SHA, SPA, and TPA as specified. If REPLY_HA is provided, then +# it should be the hardware address of the target to expect to receive in an +# ARP reply; otherwise no reply is expected. +# +# INPORT is an lport number, e.g. 11 for vif11. +# SHA and REPLY_HA are each 12 hex digits. +# SPA and TPA are each 8 hex digits. +test_arp() { +local inport=$1 sha=$2 spa=$3 tpa=$4 reply_ha=$5 +local request=${sha}08060001080006040001${sha}${spa}${tpa} +hv=hv`vif_to_hv $inport` +as $hv ovs-appctl netdev-dummy/receive vif$inport $request +#as $hv ovs-appctl ofproto/trace br-int in_port=$inport $request + +# Expect to receive the broadcast ARP on the other logical switch ports. +# (OVN should probably suppress these.) +local i=`vif_to_ls $inport` +local j +for j in 1 2 3; do +if test $i$j != $inport; then +echo $request >> $i$j.expected +fi +done + +# Expect to receive the reply, if any. +if test X$reply_ha != X; then +local reply=${sha}ff0${i}08060001080006040002${reply_ha}${tpa}${sha}${spa} +echo $reply >> $inport.expected +fi +} + +# Test router replies to ARP requests from all source ports: +# +# 3. Router replies to query for its MAC address from port's own IP address. +# +# 4. Router replies to query for its MAC address from any random IP address +#in its subnet. +# +# 5. Router replies to query for its MAC address from another subnet. +# +# 6. No reply to query for IP address other than router IP. +for i in 1 2 3; do +for j in 1 2 3; do +smac=f0$i$j # Source MAC +sip=c0a80${i}0${j} # Source IP +rip=c0a80${i}fe # Router IP +rmac=ff0$i # Router MAC +test_arp $i$j $smac $sip$rip$rmac #3 +test_arp $i$j $smac c0a80${i}55 $rip$rmac #4 +test_arp $i$j $smac 0a123456$rip$rmac #5 +test_arp $i$j $smac $sipc0a80${i}aa #6 done done -- 2.1.3 ___ dev m
[ovs-dev] [PATCH v3 3/5] physical: Fix implementation of logical patch ports.
Logical patch ports do not have a physical location and effectively reside on every hypervisor. This is fine for unicast output to logical patch ports. However, when a logical patch port is part of a logical multicast group, lumping them together with the other "local" ports in a multicast group yields packet duplication, because every hypervisor to which the packet is tunneled re-outputs it to the logical patch port. This commit fixes the problem, by treating logical patch ports as remote rather than local when they are part of a logical multicast group. This yields exactly-once semantics. Found while testing implementation of ARP in OVN logical router. The following commit adds a test that fails without this fix. Signed-off-by: Ben Pfaff Acked-by: Justin Pettit --- ovn/controller/physical.c | 43 +++ ovn/ovn-architecture.7.xml | 16 +--- 2 files changed, 44 insertions(+), 15 deletions(-) diff --git a/ovn/controller/physical.c b/ovn/controller/physical.c index 1b2b7fc..5821c11 100644 --- a/ovn/controller/physical.c +++ b/ovn/controller/physical.c @@ -497,6 +497,8 @@ physical_run(struct controller_ctx *ctx, enum mf_field_id mff_ovn_geneve, /* Handle output to multicast groups, in tables 32 and 33. */ const struct sbrec_multicast_group *mc; +struct ofpbuf remote_ofpacts; +ofpbuf_init(&remote_ofpacts, 0); SBREC_MULTICAST_GROUP_FOR_EACH (mc, ctx->ovnsb_idl) { struct sset remote_chassis = SSET_INITIALIZER(&remote_chassis); struct match match; @@ -507,11 +509,18 @@ physical_run(struct controller_ctx *ctx, enum mf_field_id mff_ovn_geneve, /* Go through all of the ports in the multicast group: * - *- For local ports, add actions to 'ofpacts' to set the output - * port and resubmit. + *- For remote ports, add the chassis to 'remote_chassis'. * - *- For remote ports, add the chassis to 'remote_chassis'. */ + *- For local ports (other than logical patch ports), add actions + * to 'ofpacts' to set the output port and resubmit. + * + *- For logical patch ports, add actions to 'remote_ofpacts' + * instead. (If we put them in 'ofpacts', then the output + * would happen on every hypervisor in the multicast group, + * effectively duplicating the packet.) + */ ofpbuf_clear(&ofpacts); +ofpbuf_clear(&remote_ofpacts); for (size_t i = 0; i < mc->n_ports; i++) { struct sbrec_port_binding *port = mc->ports[i]; @@ -528,7 +537,11 @@ physical_run(struct controller_ctx *ctx, enum mf_field_id mff_ovn_geneve, put_load(zone_id, MFF_LOG_CT_ZONE, 0, 32, &ofpacts); } -if (simap_contains(&localvif_to_ofport, +if (!strcmp(port->type, "patch")) { +put_load(port->tunnel_key, MFF_LOG_OUTPORT, 0, 32, + &remote_ofpacts); +put_resubmit(OFTABLE_DROP_LOOPBACK, &remote_ofpacts); +} else if (simap_contains(&localvif_to_ofport, port->parent_port ? port->parent_port : port->logical_port)) { put_load(port->tunnel_key, MFF_LOG_OUTPORT, 0, 32, &ofpacts); @@ -568,8 +581,13 @@ physical_run(struct controller_ctx *ctx, enum mf_field_id mff_ovn_geneve, * * Handle output to the remote chassis in the multicast group, if * any. */ -if (!sset_is_empty(&remote_chassis)) { -ofpbuf_clear(&ofpacts); +if (!sset_is_empty(&remote_chassis) || remote_ofpacts.size > 0) { +if (remote_ofpacts.size > 0) { +/* Following delivery to logical patch ports, restore the + * multicast group as the logical output port. */ +put_load(mc->tunnel_key, MFF_LOG_OUTPORT, 0, 32, + &remote_ofpacts); +} const char *chassis; const struct chassis_tunnel *prev = NULL; @@ -581,23 +599,24 @@ physical_run(struct controller_ctx *ctx, enum mf_field_id mff_ovn_geneve, } if (!prev || tun->type != prev->type) { -put_encapsulation(mff_ovn_geneve, tun, - mc->datapath, mc->tunnel_key, &ofpacts); +put_encapsulation(mff_ovn_geneve, tun, mc->datapath, + mc->tunnel_key, &remote_ofpacts); prev = tun; } -ofpact_put_OUTPUT(&ofpacts)->port = tun->ofport; +ofpact_put_OUTPUT(&remote_ofpacts)->port = tun->ofport; } -if (ofpacts.size) { +if (remote_ofpacts.size) { if (local_ports) { -put_resubmit(OFTABLE_LOCAL_OUTPUT, &ofpacts); +
Re: [ovs-dev] OVN: V2 RFC add a new JSON-RPC selective monitoringmethod
>> Will OVSDB-server have to remember whether it synced this row for >> each subscriber in order to send the right inserted/removed notifications? >> >Ovsdb-server has to maintain the state for each replica and send the right >notifications for each client. Which is a state for each row, for each monitoring client... and this state has to be maintained, when clients connect and disconnect. If we limit "where" clause to "insert" notifications and initial "monitor" response only, would it still serve OVN scalability needs appropriately? In that case, there is no need to track replica state of each client as row updates and row deletions would be sent anyway. Client should ignore row deletion if it doesn't have it in the replica. Michael ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH] ovs-ofctl: replace-flows and diff-flows support for multiple tables
Fix replace-flows and diff-flows to modify/diff flows in multiple tables. Add a --tables(-T) option that allows the user to specify a comma-separated list of table indexes to replace/diff. Signed-off-by: Shashank Shanbhag Acked-by: Romain Lenglet --- AUTHORS | 1 + NEWS | 1 + tests/ovs-ofctl.at | 129 + utilities/ovs-ofctl.8.in | 20 +- utilities/ovs-ofctl.c| 467 --- 5 files changed, 523 insertions(+), 95 deletions(-) diff --git a/AUTHORS b/AUTHORS index f4e1ca9..ef8ae10 100644 --- a/AUTHORS +++ b/AUTHORS @@ -170,6 +170,7 @@ Scott Mann sdm...@gmail.com Selvamuthukumar smku...@merunetworks.com Shad Ansari shad.ans...@hpe.com Shan Weidavids...@tencent.com +Shashank Shanbhag shashank.shanb...@gmail.com Shih-Hao Li s...@nicira.com Shu Shenshu.s...@radisys.com Simon Hormanho...@verge.net.au diff --git a/NEWS b/NEWS index 9b9dff2..ce0031c 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,7 @@ Post-v2.4.0 - Add support for connection tracking through the new "ct" action and "ct_state"/"ct_zone"/"ct_mark"/"ct_label" match fields. Only available on Linux kernels with the connection tracking module loaded. + - ovs-ofctl: replace-flows and diff-flows now operate on multiple tables. v2.4.0 - 20 Aug 2015 diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at index 33e67ed..a28da84 100644 --- a/tests/ovs-ofctl.at +++ b/tests/ovs-ofctl.at @@ -2838,27 +2838,82 @@ AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sed '/ST_FLOW reply/d' | sort OVS_VSWITCHD_STOP AT_CLEANUP - dnl Importance parameter added in OF1.4. dnl This validates whether flows with importance dnl parameter are getting replaced with "replace-flows" or dnl not by validating dump-flows output after replace with the expected output. +dnl MOD_FLOW does not modify importance field - ONF EXT-496. AT_SETUP([ovs-ofctl replace-flows with importance]) OVS_VSWITCHD_START dnl Add flows to br0 with importance via OF1.4+. For more details refer "ovs-ofctl rule with importance" test case. -for i in 1 2 3 4 5 6 7 8; do echo "dl_vlan=$i,importance=$i,actions=drop"; done > add-flows.txt +for i in 1 2 3 4 5 6 7 8; do echo "dl_vlan=$i,importance=$i actions=drop"; done | sort > add-flows.txt AT_CHECK([ovs-ofctl -O OpenFlow14 add-flows br0 add-flows.txt]) -dnl Replace some flows in the bridge. -for i in 1 3 5 7; do echo "dl_vlan=$i,importance=`expr $i + 10`,actions=drop"; done > replace-flows.txt +dnl Modify odd numbered flows. Leave even numbered ones alone. +for i in 1 2 3 4 5 6 7 8; do if [[ `expr $i % 2` -eq 1 ]]; then importance=`expr $i + 10`; else importance=$i; fi; echo " importance=$importance, dl_vlan=$i actions=drop"; done | sort > replace-flows.txt +AT_CHECK([ovs-ofctl -O OpenFlow14 replace-flows br0 replace-flows.txt]) + +dnl Dump the flows and compare them against expected output. + +for i in 1 2 3 4 5 6 7 8; do echo " importance=$i, dl_vlan=$i actions=drop"; done | sort > expout +AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sed '/OFPST_FLOW/d' | sort], [0], [expout]) + +dnl Replace some flows in the bridge. Delete flows that are not present in replace-flows.txt +dnl for i in 1 3 5 7; do echo "dl_vlan=$i,importance=`expr $i + 10` actions=drop"; done | sort > replace-flows.txt + +for i in 1 3 5 7; do echo "dl_vlan=$i,importance=$i actions=drop"; done | sort > replace-flows.txt AT_CHECK([ovs-ofctl -O OpenFlow14 replace-flows br0 replace-flows.txt]) dnl Dump them and compare the dump flows output against the expected output. -for i in 1 2 3 4 5 6 7 8; do if [[ `expr $i % 2` -eq 1 ]]; then importance=`expr $i + 10`; else importance=$i; fi; echo " importance=$importance, dl_vlan=$i actions=drop"; done | sort > expout -AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sed '/OFPST_FLOW/d' | sort], - [0], [expout]) +for i in 1 3 5 7; do echo " importance=$i, dl_vlan=$i actions=drop"; done | sort > expout +AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sed '/OFPST_FLOW/d' | sort], [0], [expout]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +dnl --tables option added to ovs-ofctl "replace-flows" and "diff-flows". +dnl This validates whether flows in table IDs specified with --tables +dnl are getting replaced with "replace-flows" or not by validating +dnl dump-flows output after replace with the expected output. + +AT_SETUP([ovs-ofctl replace-flows with --tables]) +OVS_VSWITCHD_START + +dnl Add flows to br0 for tables 1 to 8. +for i in 1 2 3 4 5 6 7 8; do echo "table=$i,dl_vlan=$i,actions=drop"; done > add-flows.txt +AT_CHECK([ovs-ofctl add-flows br0 add-flows.txt]) + +dnl Replace flows from tables 1,3,5,7 in the bridge. +for i in 1 3 5 7; do echo "table=$i,ip,nw_dst=192.168.1.$i,dl_vlan=$i,actions=drop"; done > replace-flows.txt +AT_CHECK([ovs-ofctl -O OpenFlow
Re: [ovs-dev] [PATCH] ofp-parse: Fix parsing, formatting of multiple fields in NTR extension.
On Fri, Oct 16, 2015 at 08:21:06AM -0700, Ben Pfaff wrote: > Until now, the only way to specify multiple fields in the "fields" > parameter for the Netronome groups extension, was to specify "fields" > more than once, e.g. fields=eth_dst,fields=ip_dst > > However, this wasn't documented and the code in ofp-print didn't use it, > generating output that couldn't be parsed. > > This commit fixes the situation by introducing a more straightforward > syntax, e.g. fields(eth_dst,ip_dst), documents it, and adjusts ofp-print > code to use it when there is more than one field (it retains the previous > format for backward compatibility when there is exactly one field) > > CC: Simon Horman > Signed-off-by: Ben Pfaff Acked-by: Simon Horman ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH 2/2] ofproto: correct group fields command line option parsing
On Fri, Oct 16, 2015 at 08:22:06AM -0700, Ben Pfaff wrote: > On Fri, Oct 16, 2015 at 07:50:48PM +0900, Simon Horman wrote: > > This corrects the parsing of 'fields' specified for groups on > > the command line. 'fields' may be used in conjunction with the > > Netronome selection method extension to describe which fields of > > the flow should be used as by the selection method. > > > > This patch corrects two problems with the current implementation > > as compared to the documentation in the ovs-ofctl man page. > > * Allows parsing of more than one field > > * Allows parsing of masks for fields > > > > Fixes: 18ac06d3546e ("ofp-util: Encoding and decoding of (draft) OpenFlow > > 1.5 group messages.") > > Signed-off-by: Simon Horman > > I wrote a patch yesterday that did the same thing, but now I see that I > failed to post it. I've posted it now. Can you take a look at it and > compare the effects? > http://openvswitch.org/pipermail/dev/2015-October/061318.html Funny that we were both looking at that problem at about the same time. Your approach looks good to me and I have Acked it accordingly. ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] Mail System Error - Returned Mail
Dear user dev@openvswitch.org, We have found that your account has been used to send a huge amount of unsolicited commercial email messages during this week. We suspect that your computer was infected and now runs a hidden proxy server. We recommend that you follow our instruction in order to keep your computer safe. Virtually yours, The openvswitch.org support team. ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 02/21] ofp-actions: Define IPPORT_FTP by ourselves
IPPORT_FTP is not always provided by system headers. (eg. NetBSD, OS X) This hides the enum on Linux but I don't think it causes a problem. Signed-off-by: YAMAMOTO Takashi --- lib/ofp-actions.h | 4 1 file changed, 4 insertions(+) diff --git a/lib/ofp-actions.h b/lib/ofp-actions.h index 773b617..f5a5b78 100644 --- a/lib/ofp-actions.h +++ b/lib/ofp-actions.h @@ -499,6 +499,10 @@ struct {\ uint8_t recirc_table; \ } +#if !defined(IPPORT_FTP) +#defineIPPORT_FTP 21 +#endif + /* OFPACT_CT. * * Used for NXAST_CT. */ -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 04/21] netdev-bsd: Update after eth_addr changes
Signed-off-by: YAMAMOTO Takashi --- lib/netdev-bsd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/netdev-bsd.c b/lib/netdev-bsd.c index 60e5615..118ef32 100644 --- a/lib/netdev-bsd.c +++ b/lib/netdev-bsd.c @@ -1753,7 +1753,7 @@ set_etheraddr(const char *netdev_name OVS_UNUSED, int hwaddr_family OVS_UNUSED, if (error) { return error; } -if (!memcmp(&sdl->sdl_data[sdl->sdl_nlen], mac, hwaddr_len)) { +if (!memcmp(&sdl->sdl_data[sdl->sdl_nlen], &mac, hwaddr_len)) { return 0; } oldaddr = req.addr; @@ -1765,7 +1765,7 @@ set_etheraddr(const char *netdev_name OVS_UNUSED, int hwaddr_family OVS_UNUSED, sdl->sdl_len = offsetof(struct sockaddr_dl, sdl_data) + hwaddr_len; sdl->sdl_alen = hwaddr_len; sdl->sdl_family = hwaddr_family; -memcpy(sdl->sdl_data, mac, hwaddr_len); +memcpy(sdl->sdl_data, &mac, hwaddr_len); error = af_link_ioctl(SIOCALIFADDR, &req); if (error) { return error; -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 01/21] extract-odp-netlink-h: Portablitiy improvement
\t is GNU sed extension. Use [[:space:]] instead. Signed-off-by: YAMAMOTO Takashi --- build-aux/extract-odp-netlink-h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-aux/extract-odp-netlink-h b/build-aux/extract-odp-netlink-h index b414330..aafe69a 100755 --- a/build-aux/extract-odp-netlink-h +++ b/build-aux/extract-odp-netlink-h @@ -23,7 +23,7 @@ $i\ # Use OVS's own struct eth_addr instead of a 6-byte char array. s,,"openvswitch/types.h", s,#.*,, -s/__u8[ \t]*\([a-zA-Z0-9_]*\)[ \t]*\[[ \t]*ETH_ALEN[ \t]*\]/struct eth_addr \1/ +s/__u8[[:space:]]*\([a-zA-Z0-9_]*\)[[:space:]]*\[[[:space:]]*ETH_ALEN[[:space:]]*\]/struct eth_addr \1/ # Transform most Linux-specific __u types into C99 uint_t types, # and most Linux-specific __be into Open vSwitch ovs_be, -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 06/21] daemon_switch_user: Improve portablility
NetBSD doesn't have [gs]etres[ug]id. Signed-off-by: YAMAMOTO Takashi --- lib/daemon-unix.c | 40 ++-- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/lib/daemon-unix.c b/lib/daemon-unix.c index 868e2c9..5b01d06 100644 --- a/lib/daemon-unix.c +++ b/lib/daemon-unix.c @@ -729,22 +729,20 @@ gid_matches(gid_t expected, gid_t value) } static bool -gid_verify(gid_t real, gid_t effective, gid_t saved) +gid_verify(gid_t gid) { -gid_t r, e, s; +gid_t r, e; -return (getresgid(&r, &e, &s) == 0 && -gid_matches(real, r) && -gid_matches(effective, e) && -gid_matches(saved, s)); +r = getgid(); +e = getegid(); +return (gid_matches(gid, r) && +gid_matches(gid, e)); } static void -daemon_switch_group(gid_t real, gid_t effective, -gid_t saved) +daemon_switch_group(gid_t gid) { -if ((setresgid(real, effective, saved) == -1) || -!gid_verify(real, effective, saved)) { +if ((setgid(gid) == -1) || !gid_verify(gid)) { VLOG_FATAL("%s: fail to switch group to gid as %d, aborting", pidfile, gid); } @@ -757,22 +755,20 @@ uid_matches(uid_t expected, uid_t value) } static bool -uid_verify(const uid_t real, const uid_t effective, const uid_t saved) +uid_verify(const uid_t uid) { -uid_t r, e, s; +uid_t r, e; -return (getresuid(&r, &e, &s) == 0 && -uid_matches(real, r) && -uid_matches(effective, e) && -uid_matches(saved, s)); +r = getuid(); +e = geteuid(); +return (uid_matches(uid, r) && +uid_matches(uid, e)); } static void -daemon_switch_user(const uid_t real, const uid_t effective, const uid_t saved, - const char *user) +daemon_switch_user(const uid_t uid, const char *user) { -if ((setresuid(real, effective, saved) == -1) || -!uid_verify(real, effective, saved)) { +if ((setuid(uid) == -1) || !uid_verify(uid)) { VLOG_FATAL("%s: fail to switch user to %s, aborting", pidfile, user); } @@ -794,12 +790,12 @@ daemon_become_new_user_unix(void) * that calling getuid() after each setuid() call to verify they * are actually set, because checking return code alone is not * sufficient. */ -daemon_switch_group(gid, gid, gid); +daemon_switch_group(gid); if (user && initgroups(user, gid) == -1) { VLOG_FATAL("%s: fail to add supplementary group gid %d, " "aborting", pidfile, gid); } -daemon_switch_user(uid, uid, uid, user); +daemon_switch_user(uid, user); } /* Linux specific implementation of daemon_become_new_user() -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 03/21] tnl-arp-cache: Fix NetBSD build
On NetBSD, netinet/icmp6.h has a few pre-requisite headers. Signed-off-by: YAMAMOTO Takashi --- lib/tnl-arp-cache.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/tnl-arp-cache.c b/lib/tnl-arp-cache.c index d456d0c..8a4f303 100644 --- a/lib/tnl-arp-cache.c +++ b/lib/tnl-arp-cache.c @@ -16,6 +16,8 @@ #include #include +#include +#include #include #include -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 05/21] openvswitch.m4: Portability improvement
${parameter/pattern/string} substituion is not portable. Replace them with $SED equivalent. Signed-off-by: YAMAMOTO Takashi --- m4/openvswitch.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4 index d355811..683a6a7 100644 --- a/m4/openvswitch.m4 +++ b/m4/openvswitch.m4 @@ -109,11 +109,11 @@ AC_DEFUN([OVS_CHECK_WIN32], fi if test "$cl_cv_x64" = yes; then PTHREAD_WIN32_DIR=$withval/lib/x64 -PTHREAD_WIN32_DIR_DLL=/${withval/:/}/dll/x64 +PTHREAD_WIN32_DIR_DLL=/$(echo ${withval} | ${SED} -e '/://')/dll/x64 PTHREAD_WIN32_DIR_DLL_WIN_FORM=$withval/dll/x64 else PTHREAD_WIN32_DIR=$withval/lib/x86 -PTHREAD_WIN32_DIR_DLL=/${withval/:/}/dll/x86 +PTHREAD_WIN32_DIR_DLL=/$(echo ${withval} | ${SED} -e '/://')/dll/x64 PTHREAD_WIN32_DIR_DLL_WIN_FORM=$withval/dll/x86 fi PTHREAD_INCLUDES=-I$withval/include -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 08/21] test-atomic: Bump test duration for multi-thread tests
This makes tests pass on on my single-cpu NetBSD-7 VM. How frequently preemption happens depends on the cpu scheduler. Signed-off-by: YAMAMOTO Takashi --- tests/test-atomic.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test-atomic.c b/tests/test-atomic.c index 2af6a26..efc5053 100644 --- a/tests/test-atomic.c +++ b/tests/test-atomic.c @@ -185,13 +185,14 @@ static ATOMIC(struct atomic_aux *) paux = ATOMIC_VAR_INIT(NULL); static struct atomic_aux *auxes = NULL; #define ATOMIC_ITEM_COUNT 100 +#defineDURATION 5000 static void * atomic_consumer(void * arg1 OVS_UNUSED) { struct atomic_aux *old_aux = NULL; uint64_t count; -long long int stop_time = time_msec() + 1000; +long long int stop_time = time_msec() + DURATION; do { struct atomic_aux *aux; @@ -263,7 +264,7 @@ atomic_reader(void *aux_) uint64_t count; uint64_t data; long long int now = time_msec(); -long long int stop_time = now + 1000; +long long int stop_time = now + DURATION; do { /* Non-synchronized add. */ @@ -301,7 +302,7 @@ atomic_writer(void *aux_) uint64_t data; size_t i; long long int now = time_msec(); -long long int stop_time = now + 1000; +long long int stop_time = now + DURATION; for (i = 0; i < ATOMIC_ITEM_COUNT; i++) { /* Wait for the reader to be done with the data. */ -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 10/21] ofproto-macros.at: Add another strerror(0) value
On NetBSD, strerror(0) is "Undefined error: 0". Signed-off-by: YAMAMOTO Takashi --- tests/ofproto-macros.at | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at index 94d7c86..368dade 100644 --- a/tests/ofproto-macros.at +++ b/tests/ofproto-macros.at @@ -28,7 +28,8 @@ prt==1 { sub(/[ \t]*$/, ""); print $0 } vconn_sub() { sed ' s/tcp:127.0.0.1:[0-9][0-9]*:/unix:/ -s/No error/Success/ +s/(No error)/(Success)/ +s/(Undefined error: 0)/(Success)/ ' } -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 07/21] completion.at: Improve portability
NetBSD's /bin/sh complains on the syntax of bash array. While the use of eval might seem overkill, it's tricky to avoid the error because the generated code will be a part of the surrounding subshell and the syntax check is done a bit earlier than the execution of these conditionals. Signed-off-by: YAMAMOTO Takashi --- tests/completion.at | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/completion.at b/tests/completion.at index 0aca7aa..79093f9 100644 --- a/tests/completion.at +++ b/tests/completion.at @@ -341,7 +341,8 @@ echo "$@" | tr ' ' '\n' | sed -e '/^$/d' | sed -e 's/$/ /g' | sort -u ]) AT_SETUP([vsctl-bashcomp - basic verification]) -AT_SKIP_IF([test -z ${BASH_VERSION+x} || test ${BASH_VERSINFO[[0]]} -lt 4]) +AT_SKIP_IF([test -z ${BASH_VERSION+x}]) +AT_SKIP_IF([eval 'test ${BASH_VERSINFO[[0]]} -lt 4']) OVS_VSWITCHD_START # complete ovs-vsctl --db=* [TAB] @@ -422,7 +423,8 @@ AT_CLEANUP AT_SETUP([vsctl-bashcomp - argument completion]) -AT_SKIP_IF([test -z ${BASH_VERSION+x} || test ${BASH_VERSINFO[[0]]} -lt 4]) +AT_SKIP_IF([test -z ${BASH_VERSION+x}]) +AT_SKIP_IF([eval 'test ${BASH_VERSINFO[[0]]} -lt 4']) OVS_VSWITCHD_START( [add-br br1 -- \ set bridge br1 datapath-type=dummy -- \ @@ -748,7 +750,8 @@ AT_CLEANUP AT_SETUP([vsctl-bashcomp - negative test]) -AT_SKIP_IF([test -z ${BASH_VERSION+x} || test ${BASH_VERSINFO[[0]]} -lt 4]) +AT_SKIP_IF([test -z ${BASH_VERSION+x}]) +AT_SKIP_IF([eval 'test ${BASH_VERSINFO[[0]]} -lt 4']) OVS_VSWITCHD_START # complete non-matching command. @@ -786,4 +789,4 @@ OVS_VSWITCHD_STOP AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test ""], [1], []) -AT_CLEANUP \ No newline at end of file +AT_CLEANUP -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 12/21] ovn-controller-vtep.at: Fix a race
Signed-off-by: YAMAMOTO Takashi --- tests/ovn-controller-vtep.at | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ovn-controller-vtep.at b/tests/ovn-controller-vtep.at index 497386c..fd6026f 100644 --- a/tests/ovn-controller-vtep.at +++ b/tests/ovn-controller-vtep.at @@ -113,6 +113,7 @@ AT_SETUP([ovn-controller-vtep - test chassis]) OVN_CONTROLLER_VTEP_START # verifies the initial ovn-sb db configuration. +OVS_WAIT_UNTIL([test -n "`ovn-sbctl show | grep Chassis`"]) AT_CHECK([ovn-sbctl show], [0], [dnl Chassis br-vtep Encap vxlan -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 13/21] dpif_dummy_override: Allow overriding a non-existing provider
This allows --enable-dummy=system with a userland-only build. It's useful for testsuite. Signed-off-by: YAMAMOTO Takashi --- lib/dpif-netdev.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 47fa9e2..4dcfded 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -3786,7 +3786,14 @@ dpif_dummy_register__(const char *type) static void dpif_dummy_override(const char *type) { -if (!dp_unregister_provider(type)) { +int error; + +/* + * Ignore EAFNOSUPPORT to allow --enable-dummy=system with + * a userland-only build. It's useful for testsuite. + */ +error = dp_unregister_provider(type); +if (error == 0 || error == EAFNOSUPPORT) { dpif_dummy_register__(type); } } -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 09/21] ofproto-macros.at: Rename vconn_windows_sub to vconn_sub
This is a preparation to add non-windows stuff. Signed-off-by: YAMAMOTO Takashi --- tests/ofproto-macros.at | 4 ++-- tests/ofproto.at| 4 ++-- tests/ovs-ofctl.at | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at index fe99186..94d7c86 100644 --- a/tests/ofproto-macros.at +++ b/tests/ofproto-macros.at @@ -16,7 +16,7 @@ s/ hard_age=[0-9]*,// } # Filter (multiline) vconn debug messages from ovs-vswitchd.log. -# Use with vconn_windows_sub() and ofctl_strip() +# Use with vconn_sub() and ofctl_strip() print_vconn_debug () { awk -F\| < ovs-vswitchd.log ' BEGIN { prt=0 } /\|vconn\|DBG\|/ { sub(/[ \t]*$/, ""); print $3 "|" $4 "|" $5; prt=1; next } @@ -25,7 +25,7 @@ prt==1 { sub(/[ \t]*$/, ""); print $0 } ' } -vconn_windows_sub() { +vconn_sub() { sed ' s/tcp:127.0.0.1:[0-9][0-9]*:/unix:/ s/No error/Success/ diff --git a/tests/ofproto.at b/tests/ofproto.at index 8699c4a..4a94f86 100644 --- a/tests/ofproto.at +++ b/tests/ofproto.at @@ -3952,8 +3952,8 @@ NXST_FLOW reply: dnl Check logs for OpenFlow trace # Prevent race. -OVS_WAIT_UNTIL([cat ovs-vswitchd.log | vconn_windows_sub | test `grep -- "|vconn|DBG|unix: sent (Success): NXST_FLOW reply" | wc -l` -ge 3]) -AT_CHECK([print_vconn_debug | vconn_windows_sub | ofctl_strip], [0], [dnl +OVS_WAIT_UNTIL([cat ovs-vswitchd.log | vconn_sub | test `grep -- "|vconn|DBG|unix: sent (Success): NXST_FLOW reply" | wc -l` -ge 3]) +AT_CHECK([print_vconn_debug | vconn_sub | ofctl_strip], [0], [dnl vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5): version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 vconn|DBG|unix: received: OFPT_HELLO: diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at index 33e67ed..798f81a 100644 --- a/tests/ovs-ofctl.at +++ b/tests/ovs-ofctl.at @@ -2883,9 +2883,9 @@ AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sed '/OFPST_FLO dnl Check logs for OpenFlow trace # Prevent race. -OVS_WAIT_UNTIL([cat ovs-vswitchd.log | vconn_windows_sub | test `grep -- "|vconn|DBG|unix: sent (Success): OFPST_FLOW reply" | wc -l` -ge 2]) +OVS_WAIT_UNTIL([cat ovs-vswitchd.log | vconn_sub | test `grep -- "|vconn|DBG|unix: sent (Success): OFPST_FLOW reply" | wc -l` -ge 2]) # AT_CHECK([sed -n "s/^.*\(|vconn|DBG|.*xid=.*:\).*$/\1/p" ovs-vswitchd.log], [0], [dnl -AT_CHECK([print_vconn_debug | vconn_windows_sub | ofctl_strip], [0], [dnl +AT_CHECK([print_vconn_debug | vconn_sub | ofctl_strip], [0], [dnl vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5): version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 vconn|DBG|unix: received: OFPT_HELLO (OF1.4): -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 11/21] use "/usr/bin/env python" for shebangs for python scripts
On NetBSD, a typical path of python interpreter is /usr/pkg/bin/python. Signed-off-by: YAMAMOTO Takashi --- debian/ovs-monitor-ipsec | 2 +- ofproto/ipfix-gen-entities| 2 +- utilities/ovs-dev.py | 2 +- utilities/ovs-pipegen.py | 2 +- utilities/qemu-wrap.py| 2 +- vtep/ovs-vtep | 2 +- xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/debian/ovs-monitor-ipsec b/debian/ovs-monitor-ipsec index ffaa979..d35ec46 100755 --- a/debian/ovs-monitor-ipsec +++ b/debian/ovs-monitor-ipsec @@ -1,4 +1,4 @@ -#!/usr/bin/python +#! /usr/bin/env python # Copyright (c) 2009, 2010, 2011, 2012 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ofproto/ipfix-gen-entities b/ofproto/ipfix-gen-entities index 4d4e0de..7cd0b03 100755 --- a/ofproto/ipfix-gen-entities +++ b/ofproto/ipfix-gen-entities @@ -1,4 +1,4 @@ -#!/usr/bin/python +#! /usr/bin/env python # # Copyright (C) 2012 Nicira, Inc. # diff --git a/utilities/ovs-dev.py b/utilities/ovs-dev.py index e4314c0..9ef9723 100755 --- a/utilities/ovs-dev.py +++ b/utilities/ovs-dev.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#! /usr/bin/env python # Copyright (c) 2013, 2014, 2015 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/utilities/ovs-pipegen.py b/utilities/ovs-pipegen.py index 95647d1..4bf240f 100755 --- a/utilities/ovs-pipegen.py +++ b/utilities/ovs-pipegen.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#! /usr/bin/env python # Copyright (c) 2013, 2014, 2015 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/utilities/qemu-wrap.py b/utilities/qemu-wrap.py index 5cee849..7847c8c 100755 --- a/utilities/qemu-wrap.py +++ b/utilities/qemu-wrap.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#! /usr/bin/env python # # BSD LICENSE # diff --git a/vtep/ovs-vtep b/vtep/ovs-vtep index a774e02..46a5692 100755 --- a/vtep/ovs-vtep +++ b/vtep/ovs-vtep @@ -1,4 +1,4 @@ -#!/usr/bin/python +#! /usr/bin/env python # Copyright (C) 2013 Nicira, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync index 1c8ad51..f5c38be 100755 --- a/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync +++ b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync @@ -1,4 +1,4 @@ -#!/usr/bin/python +#! /usr/bin/env python # Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 15/21] ofproto-dpif.at: Fix a race
Signed-off-by: YAMAMOTO Takashi --- tests/ofproto-dpif.at | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at index bc2daf1..f64c56c 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -7014,6 +7014,7 @@ AT_CHECK([ovs-ofctl add-flow br0 "vlan_tci=0x000a/0x0fff,action=output:local"]) AT_CHECK([ovs-appctl netdev-dummy/receive p0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x8100),vlan(vid=10,pcp=0),encap(eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0))']) +OVS_WAIT_UNTIL([grep flow_add: ovs-vswitchd.log]) AT_CHECK([cat ovs-vswitchd.log | grep 'in_port=[[1]]' | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl recirc_id=0,ip,in_port=1,dl_vlan=10,nw_frag=no, actions: ]) -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 14/21] vtep-ctl.at: Fix a regex
} is an ordinary character in "basic" regex. Signed-off-by: YAMAMOTO Takashi --- tests/vtep-ctl.at | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/vtep-ctl.at b/tests/vtep-ctl.at index f4a7edf..99e97e8 100644 --- a/tests/vtep-ctl.at +++ b/tests/vtep-ctl.at @@ -898,7 +898,7 @@ AT_CHECK([RUN_VTEP_CTL( [bind-ls a a1 100 ls1], [set Physical_Switch a management_ips=[[4.3.2.1]] tunnel_ips=[[1.2.3.4]]])], [0], [ignore], [], [VTEP_CTL_CLEANUP]) -AT_CHECK([vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket show | tail -n+2 | sed 's/=[[a-f0-9-]][[a-f0-9-]]*\}/=\}/' ], [0], [dnl +AT_CHECK([vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket show | tail -n+2 | sed 's/=[[a-f0-9-]][[a-f0-9-]]*}/=}/' ], [0], [dnl Manager "tcp:4.5.6.7" Physical_Switch a management_ips: [["4.3.2.1"]] -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 16/21] ofproto-dpif: Remove a debug log
The message seems stale and it happens on port-mod. Signed-off-by: YAMAMOTO Takashi --- ofproto/ofproto-dpif.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 5cc64cb..7c5e90d 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -1635,8 +1635,6 @@ wait(struct ofproto *ofproto_) mcast_snooping_wait(ofproto->ms); stp_wait(ofproto); if (ofproto->backer->need_revalidate) { -/* Shouldn't happen, but if it does just go around again. */ -VLOG_DBG_RL(&rl, "need revalidate in ofproto_wait_cb()"); poll_immediate_wake(); } -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 21/21] classifier-private.h: Whitespace in a comment
Signed-off-by: YAMAMOTO Takashi --- lib/classifier-private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/classifier-private.h b/lib/classifier-private.h index f68a7d2..0f8ad1e 100644 --- a/lib/classifier-private.h +++ b/lib/classifier-private.h @@ -75,7 +75,7 @@ struct cls_match { /* Rule versioning. * * CLS_NOT_REMOVED_VERSION has a special meaning for 'remove_version', - * meaningthat the rule has been added but not yet removed. + * meaning that the rule has been added but not yet removed. */ const cls_version_t add_version;/* Version rule was added in. */ ATOMIC(cls_version_t) remove_version; /* Version rule is removed in. */ -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 19/21] ofproto.at: Workaround a race
While a barrier serializes requests from the same connection, it doesn't wait for requests from other connections to the switch. Replace the barrier with infamous "sleep 1" to workaround the problem. Signed-off-by: YAMAMOTO Takashi --- tests/ofproto.at | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/ofproto.at b/tests/ofproto.at index e1cb430..c947582 100644 --- a/tests/ofproto.at +++ b/tests/ofproto.at @@ -2430,8 +2430,7 @@ udp,vlan_tci=0x,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172 fi AT_FAIL_IF([test X"$1" != X]) -ovs-appctl -t ovs-ofctl ofctl/barrier -echo >>expout "OFPT_BARRIER_REPLY (OF1.2):" +sleep 1 AT_CHECK( [[sed ' -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 20/21] ovs-ofctl.at: Fix a comment typo
Signed-off-by: YAMAMOTO Takashi --- tests/ovs-ofctl.at | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at index 798f81a..4dd10cc 100644 --- a/tests/ovs-ofctl.at +++ b/tests/ovs-ofctl.at @@ -2813,7 +2813,7 @@ AT_CLEANUP dnl Check importance parameter added in OF1.4. dnl It validates whether importance set via add-flow via OpenFlow1.4+ gets -dnl set or not by validating it againt the dump-flows output via OpenFlow1.4+ +dnl set or not by validating it against the dump-flows output via OpenFlow1.4+ dnl If add-flow or dump-flows is used with later version of OpenFlow prior to 1.4+ dnl then the importance will be considered zero whether provided as an argument. -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 17/21] ofproto-dpif.at: Workaround a race
Signed-off-by: YAMAMOTO Takashi --- tests/ofproto-dpif.at | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at index f64c56c..b93c8fb 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -844,6 +844,7 @@ AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) AT_CHECK([ovs-ofctl mod-port br0 5 noforward]) AT_CHECK([ovs-ofctl mod-port br0 6 noflood]) +sleep 1 # wait for revalidation AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(100),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout]) AT_CHECK([tail -1 stdout \ | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH 18/21] ofproto.at: Portability improvement
== is a bash dialect. Use = instead. Signed-off-by: YAMAMOTO Takashi --- tests/ofproto.at | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ofproto.at b/tests/ofproto.at index 4a94f86..e1cb430 100644 --- a/tests/ofproto.at +++ b/tests/ofproto.at @@ -3642,8 +3642,8 @@ set_and_check_poorly_specified_ofports () { AT_CHECK([test "$p1" = "$1" || test "$p2" = "$1"]) # The other port number must be different (already tested above). else -AT_CHECK([test "$1" = '[[]]' || test "$p1" == "$1"]) -AT_CHECK([test "$2" = '[[]]' || test "$p2" == "$2"]) +AT_CHECK([test "$1" = '[[]]' || test "$p1" = "$1"]) +AT_CHECK([test "$2" = '[[]]' || test "$p2" = "$2"]) fi } for pre in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \ -- 2.3.8 (Apple Git-58) ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] Hi
Oë'bN£µ´rbì·ð/äR-UI?J7ÖÁÝÌ|l:EVþPpM&È> ÏíÊlræØ©'±fb:®÷Ùò¯ TøºµuÕ7~}äé]Þf©§ÃTòI"[fÏs%_¥p »h"&»nHÅß¿ÉÈÜå¡ ¯8üñ;ZrDZåèB.ÕX4ÊÆ¦;FPdWãFù³È2¸w$é|ý±Üu&¤#½¯ ¹¢ùý®Ãï÷tVEf~aöÉJéÑVé05RtJR×ìÊv ©í÷Õ®7Ì&âüe;i¨ýcé¦q¶Fó6¹©mßpóçÏ NöCõ¼¿.ö»àè8ÁüذËî|5 ¾Zqq}Ã|Ùn×®ìÜFgÊÙæ %|ÙLmìì7a8û U&~Øú[Æ$7 ¤Ôx.fYë¼aì]Ír0CV¼em7È®ÔþlDÛªW0qÀ Åñ<Ü3¤w>ƨÎq|8S-\UÒ£)gàj¹Tø9Hd?&z &KZ_2$Âð² Xçö_j]ÇPÌ ÊÉón~¾YvÞÎ$ÖÛð{(§û(mÑ¡d#H d;ïÃUÄöæf¸« 7z¯µ4¢«AEÊ2ÊäOÓV?tÁ2þ/ Ò;Q4¦0¢44.QØÙJÓn¼cûK /^÷%tïI/,Ñþz;®ÜÝÉ8.ÊÝÙ¶Ýcó&Ö IÔÈABnºLƾ#WPô&X§Ä7 Ç#"Ö/ðÄéôµîTæO1t§)Ï[¶jÅ¢¶-Ô-E%òÎ÷¿I4yÓÈAðuÒä\d°Ä´° EQOo~7ÊQJôéÒ1ögÙÒ/ø¸é;×T`á;6³³ÍÀúÞ¨íZ>ýç9ýlz¢Ã²©Lõ08ÚÅá!V9Ê«iÁjóªRCÅÎeX)]Px¯CÚìõÔ~Ûlö1-»£iQ©Èl:J®ÃT4¢$Ånýü'-?y#W^«´|þTLé(:¹$hP!þÕÜÇj jÊìÞÕ*f)Û¨f~ǾóÛ4]è_ï1²ä#Ë¥©;/ÏQ býöáE/§7±1;#5dyY'8ÓÜÐÇQgΩk»b QN¶mï©$MïH¹( ÄÑkZy¶ ÔÏ;Á-Ö#¨X% G PÃzAÉx«uçàþÕPìvÉqTt1qèEÒßkk[°ª)«G§À¡Ûì>4¦%ùCàäø¯Q 3Dæ»m(ŲFMy¡)k×µª·£q´ÖT§}®®Âm d¤ÞI%ýO%S³È8iZôö ³'¤éËãtòH/¡Ôå^kNÑ®1å»G¡Îwf&¬)'\é0"0Òó?øtê0X"}<`õ¹obK{²¨ôAáAÒ_éz:hõóÏ3&ÚÀáÍÀu à ëá5|¿áêõÇÕÆÌàÐÇÕgõ~ þ|D}È5õ¾[Ø$,Íõæµ¬Ý çFÞ-G "µG»xg|¸´Ì¶s Ïùd¸æ«ÝGlÁ)Jû´FvëO¼nÙêacl{äÔi ÔmçS¶0ÜÒ,8C³©aZÎÍÓód¢oq_¤ 'ÛobÈÂoß¶Ï0\ V½ ×YË?°}q|.¢ ô´²>,ÒläÎ:3%» 6!>0¼Oγü$` _H¾º¬7RNÛ!òÜÛ*XkyyÒF¦ý Òö^õÚËÑRüá¼e»½¿C(hê.ºì¨è}-'µmß[N»¼HDá¸ù%«UÚCãð·iùÞø¥I):"mß;ÈñM¤ 3ºùDûTµîü.å|Á{ÇNk(ÖðàS·HSûÛòmuX~Ár/ôÃQV7Ý&TéG8± LçäVØu½¶G«§jØhkW»Å ¡°,sÂ2â uð6Òíì÷³«HH_FÜÍ2b7¦h¬¼n4ÇHáFXu¢hõÎÜNØÜ)9 bëêLʵAÃÉHaW7ض´7ä\I{Dáãä#5$~éfÒgGWò>ºȧ,¬ìoG(_ºoò÷ËDÚ§0G 1ÂQgçÛÌ©¤1Ü0×Ú±D6Hlãuħåm²¼á&úkѶ÷~°Þ¹s! %Ò|éõ-½GµÚ©² ÚÖãîïó"§VYGÐ[¬s¢Vô2ò{4¦êà§)ÚökGdîÐ¥þÀ[Ú0UÑH4Hw,æ!Å9èʲÂÞQ*g¦5¯o£¥¡F Ô´mëá ñº³oÏ]eyÃ:ÕVí(óÈç}}G, úá"°Wó_(Á7Â¥6ìÅSîj9âÍÅ»u«ôM!3*&?ð¥{ÂÇÖ¬u`ذÄ#Xh,ª§xIKç³û uW#jÒñ4qƣ£";Vþ.Oo ÒìÃWùðÝÈ>AprP6?áØ¹¬V¹F,N}ÎüI_qc^÷ Ð:¾º&¬^4W{¦±²À/ HçgèÀ¡ 6¹ag*ò&¶Â ôQspò;×k¶Sñ$÷|~òè©ç9ñ¥CÑ0ë:;¤Þ%Æ. gÇÓå«#ȺÀ&Áë8ýÞþµP¼ÀxN]ÒÍRA0ÆÄé½/Ç [É.BA´ÓAª<;~Ry©)}o]ñ´(îtÎDOÙisõ¯{×;Í㣪ÝÒuÐ#Û¬-UÑcßÛç k¥W'Á2'ã-û¬ ií¶Õaãüq¶]¾ôCI|YomÐîr ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH 06/21] daemon_switch_user: Improve portablility
On Sun, Oct 18, 2015 at 9:28 PM, YAMAMOTO Takashi wrote: > NetBSD doesn't have [gs]etres[ug]id. > > Signed-off-by: YAMAMOTO Takashi > --- > lib/daemon-unix.c | 40 ++-- > 1 file changed, 18 insertions(+), 22 deletions(-) > Thanks for testing on NetBSD. I am concerned that on platforms supports saved uid, Would this patch leave that value not changed, thus open up a security risk? How about we add a stub version of [gs]etres[ug]id for the NetBSD platform that can safely ignore the saved uid/ gid for that platform? ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH 06/21] daemon_switch_user: Improve portablility
hi, On Mon, Oct 19, 2015 at 3:14 PM, Andy Zhou wrote: > On Sun, Oct 18, 2015 at 9:28 PM, YAMAMOTO Takashi > wrote: >> NetBSD doesn't have [gs]etres[ug]id. >> >> Signed-off-by: YAMAMOTO Takashi >> --- >> lib/daemon-unix.c | 40 ++-- >> 1 file changed, 18 insertions(+), 22 deletions(-) >> > Thanks for testing on NetBSD. > > I am concerned that on platforms supports saved uid, Would this patch > leave that value not changed, thus open up a security risk? > > How about we add a stub version of [gs]etres[ug]id for the NetBSD > platform that can safely ignore the saved uid/ gid for that platform? NetBSD has saved uid/gid. saved ids are expected to be changed by set[ug]id. http://pubs.opengroup.org/onlinepubs/9699919799/functions/setuid.html http://man.netbsd.org/HEAD/usr/share/man/html2/setuid.html i'm not sure what security risks you are concerning about. ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev