On Mon, Nov 09, 2015 at 10:51:48AM -0200, Thadeu Lima de Souza Cascardo wrote:
> On Fri, Nov 06, 2015 at 03:08:29PM -0800, Ben Pfaff wrote:
> > The _error version should be used to report errors.
> >
> > Signed-off-by: Ben Pfaff <[email protected]>
> > ---
> > lib/ovs-router.c | 11 ++++++-----
> > 1 file changed, 6 insertions(+), 5 deletions(-)
> >
> > diff --git a/lib/ovs-router.c b/lib/ovs-router.c
> > index 2f093e8..50737a2 100644
> > --- a/lib/ovs-router.c
> > +++ b/lib/ovs-router.c
> > @@ -275,7 +275,8 @@ ovs_router_add(struct unixctl_conn *conn, int argc,
> > gw6 = in6addr_any;
> > }
> > } else {
> > - unixctl_command_reply(conn, "Invalid parameters");
> > + unixctl_command_reply_error(conn, "Invalid parameters");
> > + return;
> > }
> > ovs_router_insert__(plen + 32, &ip6, plen, argv[2], &gw6);
> > unixctl_command_reply(conn, "OK");
> > @@ -293,13 +294,13 @@ ovs_router_del(struct unixctl_conn *conn, int argc
> > OVS_UNUSED,
> > in6_addr_set_mapped_ipv4(&ip6, ip);
> > plen += 96;
> > } else if (!scan_ipv6_route(argv[1], &ip6, &plen)) {
> > - unixctl_command_reply(conn, "Invalid parameters");
> > + unixctl_command_reply_error(conn, "Invalid parameters");
> > }
> > if (rt_entry_delete(plen + 32, &ip6, plen)) {
> > unixctl_command_reply(conn, "OK");
> > seq_change(tnl_conf_seq);
> > } else {
> > - unixctl_command_reply(conn, "Not found");
> > + unixctl_command_reply_error(conn, "Not found");
> > }
> > }
> >
> > @@ -347,7 +348,7 @@ ovs_router_lookup_cmd(struct unixctl_conn *conn, int
> > argc OVS_UNUSED,
> > if (scan_ipv4_route(argv[1], &ip, &plen) && plen == 32) {
> > in6_addr_set_mapped_ipv4(&ip6, ip);
> > } else if (!(scan_ipv6_route(argv[1], &ip6, &plen) && plen == 128)) {
> > - unixctl_command_reply(conn, "Invalid parameters");
> > + unixctl_command_reply_error(conn, "Invalid parameters");
> > }
>
> This should have a return here as well. Otherwise, we may query for an invalid
> address, and would assert at the second unixctl_command_reply.
Thanks, I've fixed that for v2:
http://openvswitch.org/pipermail/dev/2015-November/062087.html
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev