From: Guillaume Nault <gnault@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH iproute2] utils: bump max args number to 256 for batch files
Date: Fri, 11 Jun 2021 11:51:26 +0200 [thread overview]
Message-ID: <20210611095126.GA1750@linux.home> (raw)
In-Reply-To: <20210610161742.64e4c0e5@hermes.local>
On Thu, Jun 10, 2021 at 04:17:42PM -0700, Stephen Hemminger wrote:
> On Thu, 10 Jun 2021 09:58:57 +0200
> Guillaume Nault <gnault@redhat.com> wrote:
> > > diff --git a/include/utils.h b/include/utils.h
> > > index 187444d52b41..6c4c403fe6c2 100644
> > > --- a/include/utils.h
> > > +++ b/include/utils.h
> > > @@ -50,6 +50,9 @@ void incomplete_command(void) __attribute__((noreturn));
> > > #define NEXT_ARG_FWD() do { argv++; argc--; } while(0)
> > > #define PREV_ARG() do { argv--; argc++; } while(0)
> > >
> > > +/* upper limit for batch mode */
> > > +#define MAX_ARGS 512
> > > +
> > > #define TIME_UNITS_PER_SEC 1000000
> > > #define NSEC_PER_USEC 1000
> > > #define NSEC_PER_MSEC 1000000
> > > diff --git a/lib/utils.c b/lib/utils.c
> > > index 93ae0c55063a..0559923beced 100644
> > > --- a/lib/utils.c
> > > +++ b/lib/utils.c
> > > @@ -1714,10 +1714,10 @@ int do_batch(const char *name, bool force,
> > >
> > > cmdlineno = 0;
> > > while (getcmdline(&line, &len, stdin) != -1) {
> > > - char *largv[100];
> > > + char *largv[MAX_ARGS];
> > > int largc;
> > >
> > > - largc = makeargs(line, largv, 100);
> > > + largc = makeargs(line, largv, MAX_ARGS);
> > > if (!largc)
> > > continue; /* blank line */
> > >
> > >
> >
> > Is this a patch you're going to apply, or should I repost it formally?
> >
>
> Either way, you get credit
I've sent v2. Thanks.
prev parent reply other threads:[~2021-06-11 9:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-01 17:09 [PATCH iproute2] utils: bump max args number to 256 for batch files Guillaume Nault
2021-06-09 23:59 ` Stephen Hemminger
2021-06-10 7:58 ` Guillaume Nault
2021-06-10 23:17 ` Stephen Hemminger
2021-06-11 9:51 ` Guillaume Nault [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210611095126.GA1750@linux.home \
--to=gnault@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.