All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Alexey Dobriyan <adobriyan@gmail.com>,
	Stefan Hellermann <stefan@the2masters.de>
Cc: andrew@lunn.ch, linux@arm.linux.org.uk, jason@lakedaemon.net,
	netdev@vger.kernel.org, "\[ 4 . 4+ \]" <stable@vger.kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	gregory.clement@free-electrons.com, dv@vollmann.ch
Subject: Re: [PATCH] net: Allow mac_pton() to work on non-NULL terminated strings
Date: Fri, 23 Feb 2018 22:51:07 +0200	[thread overview]
Message-ID: <1519419067.10722.139.camel@linux.intel.com> (raw)
In-Reply-To: <20180223204104.GA15686@avx2>

On Fri, 2018-02-23 at 23:41 +0300, Alexey Dobriyan wrote:
> On Fri, Feb 23, 2018 at 09:17:48PM +0100, Stefan Hellermann wrote:
> > @@ -8,10 +8,6 @@ bool mac_pton(const char *s, u8 *mac)
> >  {
> >  	int i;
> >  
> > -	/* XX:XX:XX:XX:XX:XX */
> > -	if (strlen(s) < 3 * ETH_ALEN - 1)
> > -		return false;
> > -
> >  	/* Don't dirty result unless string is valid MAC. */
> >  	for (i = 0; i < ETH_ALEN; i++) {
> >  		if (!isxdigit(s[i * 3]) || !isxdigit(s[i * 3 + 1]))
> 
> Short string will bail in the loop, indeed.
> 
> Reviewed-by: Alexey Dobriyan <adobriyan@gmail.com>

Since the author is okay with the change, I'm following:

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Alexey Dobriyan <adobriyan@gmail.com>,
	Stefan Hellermann <stefan@the2masters.de>
Cc: netdev@vger.kernel.org, andrew@lunn.ch, linux@arm.linux.org.uk,
	jason@lakedaemon.net, dv@vollmann.ch,
	gregory.clement@free-electrons.com,
	linux-arm-kernel@lists.infradead.org,
	"[ 4 . 4+ ]" <stable@vger.kernel.org>
Subject: Re: [PATCH] net: Allow mac_pton() to work on non-NULL terminated strings
Date: Fri, 23 Feb 2018 22:51:07 +0200	[thread overview]
Message-ID: <1519419067.10722.139.camel@linux.intel.com> (raw)
In-Reply-To: <20180223204104.GA15686@avx2>

On Fri, 2018-02-23 at 23:41 +0300, Alexey Dobriyan wrote:
> On Fri, Feb 23, 2018 at 09:17:48PM +0100, Stefan Hellermann wrote:
> > @@ -8,10 +8,6 @@ bool mac_pton(const char *s, u8 *mac)
> >  {
> >  	int i;
> >  
> > -	/* XX:XX:XX:XX:XX:XX */
> > -	if (strlen(s) < 3 * ETH_ALEN - 1)
> > -		return false;
> > -
> >  	/* Don't dirty result unless string is valid MAC. */
> >  	for (i = 0; i < ETH_ALEN; i++) {
> >  		if (!isxdigit(s[i * 3]) || !isxdigit(s[i * 3 + 1]))
> 
> Short string will bail in the loop, indeed.
> 
> Reviewed-by: Alexey Dobriyan <adobriyan@gmail.com>

Since the author is okay with the change, I'm following:

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

WARNING: multiple messages have this Message-ID (diff)
From: andriy.shevchenko@linux.intel.com (Andy Shevchenko)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] net: Allow mac_pton() to work on non-NULL terminated strings
Date: Fri, 23 Feb 2018 22:51:07 +0200	[thread overview]
Message-ID: <1519419067.10722.139.camel@linux.intel.com> (raw)
In-Reply-To: <20180223204104.GA15686@avx2>

On Fri, 2018-02-23 at 23:41 +0300, Alexey Dobriyan wrote:
> On Fri, Feb 23, 2018 at 09:17:48PM +0100, Stefan Hellermann wrote:
> > @@ -8,10 +8,6 @@ bool mac_pton(const char *s, u8 *mac)
> >  {
> >  	int i;
> >  
> > -	/* XX:XX:XX:XX:XX:XX */
> > -	if (strlen(s) < 3 * ETH_ALEN - 1)
> > -		return false;
> > -
> >  	/* Don't dirty result unless string is valid MAC. */
> >  	for (i = 0; i < ETH_ALEN; i++) {
> >  		if (!isxdigit(s[i * 3]) || !isxdigit(s[i * 3 + 1]))
> 
> Short string will bail in the loop, indeed.
> 
> Reviewed-by: Alexey Dobriyan <adobriyan@gmail.com>

Since the author is okay with the change, I'm following:

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

  reply	other threads:[~2018-02-23 20:51 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-02 14:12 [PATCH v2 1/1] ARM: orion5x: use mac_pton() helper Andy Shevchenko
2015-10-13 11:27 ` Detlef Vollmann
2015-10-15  7:51   ` Gregory CLEMENT
2018-02-22 17:45 ` [v2,1/1] " Stefan Hellermann
2018-02-22 21:42   ` Andrew Lunn
2018-02-22 23:18     ` Stefan Hellermann
2018-02-22 23:34       ` Andrew Lunn
2018-02-23 10:09         ` Andy Shevchenko
2018-02-23 15:01           ` Andrew Lunn
2018-02-23 15:18             ` Andy Shevchenko
2018-02-23 15:51               ` Andrew Lunn
2018-02-23 16:36                 ` Stefan Hellermann
2018-02-23 16:57                   ` Andy Shevchenko
2018-02-23 17:23                   ` Andrew Lunn
2018-02-23 18:20               ` Alexey Dobriyan
2018-02-23 20:17                 ` [PATCH] net: Allow mac_pton() to work on non-NULL terminated strings Stefan Hellermann
2018-02-23 20:17                   ` Stefan Hellermann
2018-02-23 20:17                   ` Stefan Hellermann
2018-02-23 20:27                   ` Andrew Lunn
2018-02-23 20:27                     ` Andrew Lunn
2018-02-23 20:27                     ` Andrew Lunn
2018-02-23 20:41                   ` Alexey Dobriyan
2018-02-23 20:41                     ` Alexey Dobriyan
2018-02-23 20:41                     ` Alexey Dobriyan
2018-02-23 20:51                     ` Andy Shevchenko [this message]
2018-02-23 20:51                       ` Andy Shevchenko
2018-02-23 20:51                       ` Andy Shevchenko
2018-02-26 18:37                   ` David Miller
2018-02-26 18:37                     ` David Miller

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=1519419067.10722.139.camel@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=adobriyan@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=dv@vollmann.ch \
    --cc=gregory.clement@free-electrons.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@arm.linux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=stefan@the2masters.de \
    /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.