All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arvin Schnell <arvin@suse.de>
To: linux-ppp@vger.kernel.org
Subject: Re: rename ppp interface
Date: Wed, 21 Jul 2004 14:38:50 +0000	[thread overview]
Message-ID: <20040721143850.GA7604@suse.de> (raw)
In-Reply-To: <20040716095908.GA32556@suse.de>

On Wed, Jul 21, 2004 at 05:54:59PM +0400, Michael Tokarev wrote:
> 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.

In the end the "linkname" option could be used but in a patch I
prefer to not change the existing behaviour.

> >--- ./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().

The goal is to get persistent interface names.  I suppose some
people will prefer a failure instead of a random interface name
to prevent a interface not covert by the firewall.

Anyway, if it's changed to warn the code in set_ifunit must also
be changed.

> >+		else
> >+		    info("Renamed interface %s to %s", t, req_ifname);
> 
> Is such a verbosity really necessary?  Pppd is already too noizy...

It was useful during development but can of course be removed.
There's already the "using interface xxx" message.

ciao Arvin

-- 
Dipl.-Phys. Arvin Schnell
SUSE Linux AG
Research & Development
email: arvin@suse.de

  parent reply	other threads:[~2004-07-21 14:38 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
2004-07-21 14:38 ` Arvin Schnell [this message]
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=20040721143850.GA7604@suse.de \
    --to=arvin@suse.de \
    --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.