[ovs-dev] [PATCH] ovn-nbctl: Detect unrecognized short options in server mode.

Ben Pfaff blp at ovn.org
Tue Jul 31 19:35:18 UTC 2018

On Wed, Jul 25, 2018 at 05:26:54PM +0200, Jakub Sitnicki wrote:
> 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>

Thanks, applied to master and branch-2.10.

More information about the dev mailing list