netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: shemminger@vyatta.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] net: network device name ifalias support
Date: Mon, 22 Sep 2008 21:28:34 -0700 (PDT)	[thread overview]
Message-ID: <20080922.212834.184909406.davem@davemloft.net> (raw)
In-Reply-To: <20080922204718.2782b5b6@extreme>

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 22 Sep 2008 20:47:18 -0700

> On Mon, 22 Sep 2008 19:44:23 -0700 (PDT)
> David Miller <davem@davemloft.net> wrote:
> 
> > It might be cleaner to use kstrdup() and free the old pointer, if
> > any, here.
> > 
> > 	char *new = kstrdup(alias, GFP_KERNEL);
> > 	if (!new)
> > 		return -ENOMEM;
> > 	kfree(dev->ifalias);
> > 	dev->ifalias = new;
> > 	return len;
> > 
> > That way all of this "len+1" stuff goes away.
> 
> Won't work because input string is not necessarily null-terminated.
> In the sysfs case we want there is a trailing newline, and this
> way avoids copying once there and then copying again.

Ok, fair enough.  I've applied your original patch to net-next-2.6,
thanks!

  reply	other threads:[~2008-09-23  4:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-23  0:43 [PATCH] net: network device name ifalias support Stephen Hemminger
2008-09-23  2:44 ` David Miller
2008-09-23  3:47   ` Stephen Hemminger
2008-09-23  4:28     ` David Miller [this message]
2008-09-23 19:52 ` [PATCH net-next]: net: remove ifalias on empty given alias Oliver Hartkopp
2008-09-23 20:14   ` Stephen Hemminger
2008-09-24  4:23     ` 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=20080922.212834.184909406.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).