All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: linux-ppp@vger.kernel.org
Subject: Re: rename ppp interface
Date: Wed, 21 Jul 2004 13:54:59 +0000	[thread overview]
Message-ID: <40FE75B3.7000106@tls.msk.ru> (raw)
In-Reply-To: <20040716095908.GA32556@suse.de>

Arvin Schnell wrote:
[]
> --- ./pppd/options.c.orig	2004-07-19 12:59:21.000000000 +0000
> +++ ./pppd/options.c	2004-07-19 14:35:04.253865964 +0000
> +    { "ifname", o_string, req_ifname,
> +      "Set PPP interface name",
> +      OPT_PRIO | OPT_PRIV | OPT_STATIC, NULL, MAXIFNAMELEN },

Is there any reason to use new option instead of existing
"linkname" option?  Currently, linkname is used only for
informational purposes (to be passed into scripts, and to
create /var/run/ppp-$linkname.pid file).  Existing option
seems to be better, but it may lead to unexpected problems,
namely, users who use it expects to see interface named pppN
(with current version), but with this change things may change
too.

> --- ./pppd/sys-linux.c.orig	2004-07-19 12:33:29.000000000 +0000
> +++ ./pppd/sys-linux.c	2004-07-19 14:37:36.463754450 +0000
> @@ -649,6 +649,21 @@
>  	}
>  	if (x < 0)
>  		error("Couldn't create new ppp unit: %m");
> +
> +	if (x = 0 && req_ifname[0] != '\0') {
> +		struct ifreq ifr;
> +		char t[MAXIFNAMELEN];
> +		memset(&ifr, 0, sizeof(struct ifreq));
> +		slprintf(t, sizeof(t), "%s%d", PPP_DRV_NAME, ifunit);
> +		strncpy(ifr.ifr_name, t, IF_NAMESIZE);
> +		strncpy(ifr.ifr_newname, req_ifname, IF_NAMESIZE);
> +		x = ioctl(sock_fd, SIOCSIFNAME, &ifr);
> +		if (x < 0)
> +		    error("Couldn't rename interface %s to %s: %m", t, req_ifname);

I'd suggest to change this into warn().

> +		else
> +		    info("Renamed interface %s to %s", t, req_ifname);

Is such a verbosity really necessary?  Pppd is already too noizy...

/mjt

  parent reply	other threads:[~2004-07-21 13:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-16  9:59 rename ppp interface Arvin Schnell
2004-07-19  0:10 ` James Cameron
2004-07-19 15:35 ` Arvin Schnell
2004-07-21 13:47 ` Michael Tokarev
2004-07-21 13:54 ` Michael Tokarev [this message]
2004-07-21 14:38 ` Arvin Schnell
2004-08-01 23:10 ` Herbert Xu

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=40FE75B3.7000106@tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=linux-ppp@vger.kernel.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.