On 01/20/2016 05:43 PM, Ben Pfaff wrote: > On Wed, Jan 20, 2016 at 05:33:16PM -0500, Russell Bryant wrote: >> While debugging a broken OVN environment yesterday, the problem turned >> out to be invalid entries in the logical port addresses column. In >> particular, the following command had been used: >> >> $ ovn-nbctl lport-set-addresses lp0 MAC IP >> >> instead of: >> >> $ ovn-nbctl lport-set-addresses lp0 "MAC IP" >> >> This is really easy to mess up, so add some simple validation to the >> lport-set-addresses command. If the beginning of an argument is ever >> an IP address, it's wrong. >> >> In passing, also add a note to the ovn-nb db documentation to note that >> the order of "MAC IP" is required, as "IP MAC" is not valid. >> >> Signed-off-by: Russell Bryant <russ...@ovn.org> > > Indentation in the "if" condition looks a little weird, please check it.
Yeah, for some reason I wasn't sure the best way to indent it. Here's what I changed it to, but if you'd prefer something else let me know and I'll change it. > diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c > index 507df47..8c3b3c8 100644 > --- a/ovn/utilities/ovn-nbctl.c > +++ b/ovn/utilities/ovn-nbctl.c > @@ -672,9 +672,9 @@ nbctl_lport_set_addresses(struct ctl_context *ctx) > for (i = 2; i < ctx->argc; i++) { > struct eth_addr ea; > > - if (strcmp(ctx->argv[i], "unknown") && > - !ovs_scan(ctx->argv[i], ETH_ADDR_SCAN_FMT, > - ETH_ADDR_SCAN_ARGS(ea))) { > + if (strcmp(ctx->argv[i], "unknown") > + && !ovs_scan(ctx->argv[i], ETH_ADDR_SCAN_FMT, > + ETH_ADDR_SCAN_ARGS(ea))) { > VLOG_ERR("Invalid address format (%s). See ovn-nb(5). " > "Hint: An Ethernet address must be " > "listed before an IP address, together as a single " > Acked-by: Ben Pfaff <b...@ovn.org> > Thanks, I pushed these 2 patches to master and branch-2.5. -- Russell Bryant _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev