Re: [Linuxptp-devel] [PATCH] ptp4l: Accept any configuration option as a command line argument.

2016-12-13 Thread Miroslav Lichvar
On Tue, Dec 13, 2016 at 05:34:03PM +0100, Richard Cochran wrote:
> On Tue, Dec 13, 2016 at 04:47:23PM +0100, Miroslav Lichvar wrote:
> > > + if (commandline) {
> > > + dst->flags &= CFG_ITEM_LOCKED;
> > 
> > Should this be dst->flags |= CFG_ITEM_LOCKED ?
> 
> Ouch.  Yes of course.

Ok, with this change, valgrind reports no errors and the options seem
to be working as expected. This is a nice feature! Could you please
mention it in the man page?

Thanks,

-- 
Miroslav Lichvar

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [PATCH] ptp4l: Accept any configuration option as a command line argument.

2016-12-13 Thread Richard Cochran
On Tue, Dec 13, 2016 at 04:47:23PM +0100, Miroslav Lichvar wrote:
> I'm testing the latest code from git which includes this feature. It
> doesn't seem to work correctly for me. The program accepts long
> options, but the behaviour doesn't change as if they were not
> specified. Also, valgrind reports an error about invalid free on exit.

I'll check it.

> > +   if (commandline) {
> > +   dst->flags &= CFG_ITEM_LOCKED;
> 
> Should this be dst->flags |= CFG_ITEM_LOCKED ?

Ouch.  Yes of course.

Thanks,
Richard

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [PATCH] ptp4l: Accept any configuration option as a command line argument.

2016-12-13 Thread Miroslav Lichvar
On Tue, Dec 06, 2016 at 07:49:56PM +0100, Richard Cochran wrote:
> This patch provides a way to use the entire table of configuration options
> as "long" command line switches.

I'm testing the latest code from git which includes this feature. It
doesn't seem to work correctly for me. The program accepts long
options, but the behaviour doesn't change as if they were not
specified. Also, valgrind reports an error about invalid free on exit.

==4584== Invalid free() / delete / delete[] / realloc()
==4584==at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==4584==by 0x4077DD: config_item_free (config.c:310)
==4584==by 0x4091F3: hash_destroy (hash.c:62)
==4584==by 0x4085F9: config_destroy (config.c:704)
==4584==by 0x40228A: main (ptp4l.c:221)
==4584==  Address 0x622d20 is 2240 bytes inside data symbol "config_tab"

> +
> + if (commandline) {
> + dst->flags &= CFG_ITEM_LOCKED;

Should this be dst->flags |= CFG_ITEM_LOCKED ?

-- 
Miroslav Lichvar

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel