[ovs-git] [openvswitch/ovs] 7f256d: ovn-nbctl: Detect unrecognized short options in se...

GitHub noreply at github.com
Tue Jul 31 19:35:22 UTC 2018


  Branch: refs/heads/branch-2.10
  Home:   https://github.com/openvswitch/ovs
  Commit: 7f256dc110b43f3caf54f7a3b3f345b37bb2d086
      https://github.com/openvswitch/ovs/commit/7f256dc110b43f3caf54f7a3b3f345b37bb2d086
  Author: Jakub Sitnicki <jkbs at redhat.com>
  Date:   2018-07-31 (Tue, 31 Jul 2018)

  Changed paths:
    M ovn/utilities/ovn-nbctl.c

  Log Message:
  -----------
  ovn-nbctl: Detect unrecognized short options in server mode.

Because getopt() will set optopt for both known and unknown options,
we need to differentiate between them ourselves by checking if we
know the option. Do that by looking up its value.

Also, because we are using GNU extensions to getopt(), we need to be
resetting getopt() state by setting optind to 0 instead of 1 as
pointed out in NOTES in getopt(3) man-page. Not doing so results in
invalid reads and optopt being set to a garbarge value.

Fixes: 3ec06ea9c668 ("ovn-nbctl: Initial support for daemon mode.")
Signed-off-by: Jakub Sitnicki <jkbs at redhat.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>



      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the git mailing list