linux-ppp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* rename ppp interface
@ 2004-07-16  9:59 Arvin Schnell
  2004-07-19  0:10 ` James Cameron
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Arvin Schnell @ 2004-07-16  9:59 UTC (permalink / raw)
  To: linux-ppp

[-- Attachment #1: Type: text/plain, Size: 566 bytes --]


Hi,

as you might know with the linux kernel 2.6 it is possible to
rename network interfaces.  I have made a small patch to allow
the pppd to rename it is ppp interface.  The patch is only to
demonstrate the issue - it is far from complete (no option, no
documentation, pppstats needs adaption).  If there is willingness
to include this feature in the mainline I can make a complete
patch.

Besides that, does anybody see problems with renaming of ppp
interfaces?

ciao Arvin

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

[-- Attachment #2: ppp-2.4.2-nameif.diff --]
[-- Type: text/plain, Size: 1026 bytes --]

--- ./pppd/main.c.orig	2004-07-15 14:16:09.000000000 +0000
+++ ./pppd/main.c	2004-07-15 15:01:24.000000000 +0000
@@ -777,8 +777,11 @@
 set_ifunit(iskey)
     int iskey;
 {
-    info("Using interface %s%d", PPP_DRV_NAME, ifunit);
+    if (1)
+	slprintf(ifname, sizeof(ifname), "modem");
+    else
     slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
+    info("Using interface %s", ifname);
     script_setenv("IFNAME", ifname, iskey);
     if (iskey) {
 	create_pidfile(getpid());	/* write pid to file */
--- ./pppd/sys-linux.c.orig	2004-07-15 14:16:18.000000000 +0000
+++ ./pppd/sys-linux.c	2004-07-16 09:36:24.373838222 +0000
@@ -647,6 +647,17 @@
 	}
 	if (x < 0)
 		error("Couldn't create new ppp unit: %m");
+
+	if (1) {
+		struct ifreq ifr;
+		memset(&ifr, 0, sizeof(struct ifreq));
+		strcpy(ifr.ifr_name, "ppp0");
+		strcpy(ifr.ifr_newname, "modem");
+		x = ioctl(sock_fd, SIOCSIFNAME, &ifr);
+		if (x < 0)
+		    error("Couldn't rename interface %s to %s: %m", "ppp0", "modem");
+	}
+
 	return x;
 }
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: rename ppp interface
  2004-07-16  9:59 rename ppp interface Arvin Schnell
@ 2004-07-19  0:10 ` James Cameron
  2004-07-19 15:35 ` Arvin Schnell
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: James Cameron @ 2004-07-19  0:10 UTC (permalink / raw)
  To: linux-ppp

I'm certainly interested in the patch; in the PPTP projects we regularly
get "change the interface name" as a wishlist request.  Can you tell me
which kernel version range supports the ioctl?

I'm not qualified to judge any other impacts of the change.

-- 
James Cameron                         http://quozl.netrek.org/
HP Open Source, Volunteer             http://opensource.hp.com/
PPTP Client Project, Release Engineer http://pptpclient.sourceforge.net/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: rename ppp interface
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Arvin Schnell @ 2004-07-19 15:35 UTC (permalink / raw)
  To: linux-ppp

[-- Attachment #1: Type: text/plain, Size: 680 bytes --]

On Mon, Jul 19, 2004 at 10:10:43AM +1000, James Cameron wrote:
> I'm certainly interested in the patch; in the PPTP projects we regularly
> get "change the interface name" as a wishlist request.  Can you tell me
> which kernel version range supports the ioctl?

I think the ioctl was added for kernel 2.6, but I might be wrong.
Likely the code should be placed in ifdef's.

> I'm not qualified to judge any other impacts of the change.

The only problem I found is when you try to rename several
interfaces to pppN.  Also I didn't test multilink.

Attached is an enhanced patch.

ciao Arvin

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

[-- Attachment #2: ppp-2.4.2-ifname.diff --]
[-- Type: text/plain, Size: 4420 bytes --]

--- ./pppd/main.c.orig	2004-07-19 12:35:22.000000000 +0000
+++ ./pppd/main.c	2004-07-19 14:34:38.542120946 +0000
@@ -98,7 +98,7 @@
 static const char rcsid[] = RCSID;
 
 /* interface vars */
-char ifname[32];		/* Interface name */
+char ifname[MAXIFNAMELEN];	/* Interface name */
 int ifunit;			/* Interface unit number */
 
 struct channel *the_channel;
@@ -261,13 +261,6 @@
     NULL
 };
 
-/*
- * If PPP_DRV_NAME is not defined, use the default "ppp" as the device name.
- */
-#if !defined(PPP_DRV_NAME)
-#define PPP_DRV_NAME	"ppp"
-#endif /* !defined(PPP_DRV_NAME) */
-
 int
 main(argc, argv)
     int argc;
@@ -777,8 +770,11 @@
 set_ifunit(iskey)
     int iskey;
 {
-    info("Using interface %s%d", PPP_DRV_NAME, ifunit);
+    if (req_ifname[0] != '\0')
+	slprintf(ifname, sizeof(ifname), req_ifname);
+    else
     slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
+    info("Using interface %s", ifname);
     script_setenv("IFNAME", ifname, iskey);
     if (iskey) {
 	create_pidfile(getpid());	/* write pid to file */
--- ./pppd/options.c.orig	2004-07-19 12:59:21.000000000 +0000
+++ ./pppd/options.c	2004-07-19 14:35:04.253865964 +0000
@@ -102,6 +102,7 @@
 bool	tune_kernel;		/* may alter kernel settings */
 int	connect_delay = 1000;	/* wait this many ms after connect script */
 int	req_unit = -1;		/* requested interface unit */
+char	req_ifname[MAXIFNAMELEN];	/* requested interface name */
 bool	multilink = 0;		/* Enable multilink operation */
 char	*bundle_name = NULL;	/* bundle name for multilink */
 bool	dump_options;		/* print out option values */
@@ -259,6 +260,10 @@
       "PPP interface unit number to use if possible",
       OPT_PRIO | OPT_LLIMIT, 0, 0 },
 
+    { "ifname", o_string, req_ifname,
+      "Set PPP interface name",
+      OPT_PRIO | OPT_PRIV | OPT_STATIC, NULL, MAXIFNAMELEN },
+
     { "dump", o_bool, &dump_options,
       "Print out option values after parsing all options", 1 },
     { "dryrun", o_bool, &dryrun,
--- ./pppd/pppd.8.orig	2004-07-19 14:39:06.639320497 +0000
+++ ./pppd/pppd.8	2004-07-19 15:00:37.339448432 +0000
@@ -1020,7 +1020,12 @@
 .TP
 .B unit \fInum
 Sets the ppp unit number (for a ppp0 or ppp1 etc interface name) for outbound
-connections.
+connections.  If the unit is already in use a dynamically allocated will be
+used.
+.TP
+.B ifname \fIstring
+Set the ppp interface name for outbound connections.  A failure to set the
+name will terminate the pppd.
 .TP
 .B updetach
 With this option, pppd will detach from its controlling terminal once
--- ./pppd/pppd.h.orig	2004-07-19 12:59:16.000000000 +0000
+++ ./pppd/pppd.h	2004-07-19 15:02:08.792752747 +0000
@@ -80,6 +80,16 @@
 #define MAXARGS		1	/* max # args to a command */
 #define MAXNAMELEN	256	/* max length of hostname or name for auth */
 #define MAXSECRETLEN	256	/* max length of password or secret */
+#define MAXIFNAMELEN	32	/* max length of interface name; or use IFNAMSIZ, can we
+				   always include net/if.h? */
+
+/*
+ * If PPP_DRV_NAME is not defined, use the default "ppp" as the device name.
+ * Where should PPP_DRV_NAME come from? Do we include it here?
+ */
+#if !defined(PPP_DRV_NAME)
+#define PPP_DRV_NAME	"ppp"
+#endif /* !defined(PPP_DRV_NAME) */
 
 /*
  * Option descriptor structure.
@@ -304,6 +314,7 @@
 extern int	connect_delay;	/* Time to delay after connect script */
 extern int	max_data_rate;	/* max bytes/sec through charshunt */
 extern int	req_unit;	/* interface unit number to use */
+extern char	req_ifname[MAXIFNAMELEN];	/* interface name to use */
 extern bool	multilink;	/* enable multilink operation */
 extern bool	noendpoint;	/* don't send or accept endpt. discrim. */
 extern char	*bundle_name;	/* bundle name for multilink */
--- ./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);
+		else
+		    info("Renamed interface %s to %s", t, req_ifname);
+	}
+
 	return x;
 }
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: rename ppp interface
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Michael Tokarev @ 2004-07-21 13:47 UTC (permalink / raw)
  To: linux-ppp

James Cameron wrote:
> I'm certainly interested in the patch; in the PPTP projects we regularly
> get "change the interface name" as a wishlist request.  Can you tell me
> which kernel version range supports the ioctl?

The SIOCSIFNAME ioctl is supported for ages.  Linux `nameif' program
that uses it is very old too.  At least, linux 2.2 does support it.
All after all, error() in patch may be changed into warn().

/mjt

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: rename ppp interface
  2004-07-16  9:59 rename ppp interface Arvin Schnell
                   ` (2 preceding siblings ...)
  2004-07-21 13:47 ` Michael Tokarev
@ 2004-07-21 13:54 ` Michael Tokarev
  2004-07-21 14:38 ` Arvin Schnell
  2004-08-01 23:10 ` Herbert Xu
  5 siblings, 0 replies; 7+ messages in thread
From: Michael Tokarev @ 2004-07-21 13:54 UTC (permalink / raw)
  To: linux-ppp

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: rename ppp interface
  2004-07-16  9:59 rename ppp interface Arvin Schnell
                   ` (3 preceding siblings ...)
  2004-07-21 13:54 ` Michael Tokarev
@ 2004-07-21 14:38 ` Arvin Schnell
  2004-08-01 23:10 ` Herbert Xu
  5 siblings, 0 replies; 7+ messages in thread
From: Arvin Schnell @ 2004-07-21 14:38 UTC (permalink / raw)
  To: linux-ppp

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: rename ppp interface
  2004-07-16  9:59 rename ppp interface Arvin Schnell
                   ` (4 preceding siblings ...)
  2004-07-21 14:38 ` Arvin Schnell
@ 2004-08-01 23:10 ` Herbert Xu
  5 siblings, 0 replies; 7+ messages in thread
From: Herbert Xu @ 2004-08-01 23:10 UTC (permalink / raw)
  To: linux-ppp

Arvin Schnell <arvin@suse.de> wrote:
> 
> The only problem I found is when you try to rename several
> interfaces to pppN.  Also I didn't test multilink.
> 
> Attached is an enhanced patch.

Thanks for the patch.

The only problem I see with it is that multilink doesn't work.
I actually wrote a patch from a couple of years ago that did
the same thing.  I encountered the multilink problem and fixed
it.

Perhaps you can merge some bits from my patch.

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
Index: pppd/main.c
=================================RCS file: /var/cvs/snwb/packages/ppp/pppd/main.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- pppd/main.c	26 Jul 2002 01:39:27 -0000	1.3
+++ pppd/main.c	14 Oct 2002 01:31:06 -0000	1.4
@@ -725,8 +725,11 @@
 set_ifunit(iskey)
     int iskey;
 {
-    info("Using interface %s%d", PPP_DRV_NAME, ifunit);
     slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
+    if (req_ifname[0] && sys_change_ifname(ifname, req_ifname)) {
+	slprintf(ifname, sizeof(ifname), "%s", req_ifname);
+    }
+    info("Using interface %s", ifname);
     script_setenv("IFNAME", ifname, iskey);
     if (iskey) {
 	create_pidfile();	/* write pid to file */
Index: pppd/options.c
=================================RCS file: /var/cvs/snwb/packages/ppp/pppd/options.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- pppd/options.c	25 Jul 2002 03:42:01 -0000	1.1.1.1
+++ pppd/options.c	14 Oct 2002 01:31:06 -0000	1.2
@@ -80,6 +80,7 @@
 bool	tune_kernel;		/* may alter kernel settings */
 int	connect_delay = 1000;	/* wait this many ms after connect script */
 int	req_unit = -1;		/* requested interface unit */
+char	req_ifname[16];		/* requested interface name */
 bool	multilink = 0;		/* Enable multilink operation */
 char	*bundle_name = NULL;	/* bundle name for multilink */
 bool	dump_options;		/* print out option values */
@@ -228,6 +229,10 @@
     { "unit", o_int, &req_unit,
       "PPP interface unit number to use if possible",
       OPT_PRIO | OPT_LLIMIT, 0, 0 },
+
+    { "ifname", o_string, req_ifname,
+      "PPP interface name to use if possible",
+      OPT_PRIO | OPT_PRIV | OPT_STATIC, NULL, sizeof(req_ifname) },
 
     { "dump", o_bool, &dump_options,
       "Print out option values after parsing all options", 1 },
Index: pppd/pppd.h
=================================RCS file: /var/cvs/snwb/packages/ppp/pppd/pppd.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- pppd/pppd.h	25 Jul 2002 04:03:41 -0000	1.2
+++ pppd/pppd.h	14 Oct 2002 01:31:06 -0000	1.3
@@ -269,6 +269,7 @@
 extern int	connect_delay;	/* Time to delay after connect script */
 extern int	max_data_rate;	/* max bytes/sec through charshunt */
 extern int	req_unit;	/* interface unit number to use */
+extern char	req_ifname[16];	/* interface name to use */
 extern bool	multilink;	/* enable multilink operation */
 extern bool	noendpoint;	/* don't send or accept endpt. discrim. */
 extern char	*bundle_name;	/* bundle name for multilink */
@@ -573,6 +574,7 @@
 #endif
 int  get_if_hwaddr __P((u_char *addr, char *name));
 char *get_first_ethernet __P((void));
+int sys_change_ifname __P((const char *, const char *));
 
 /* Procedures exported from options.c */
 int setipaddr __P((char *, char **, int)); /* Set local/remote ip addresses */
Index: pppd/sys-linux.c
=================================RCS file: /var/cvs/snwb/packages/ppp/pppd/sys-linux.c,v
retrieving revision 1.4
retrieving revision 1.6
diff -u -r1.4 -r1.6
--- pppd/sys-linux.c	20 Sep 2002 04:05:31 -0000	1.4
+++ pppd/sys-linux.c	14 Oct 2002 01:53:01 -0000	1.6
@@ -2761,3 +2761,27 @@
     }
     return 1;
 }
+
+int
+sys_change_ifname(const char *old, const char *new)
+{
+    struct ifreq ifr;
+
+    SYSDEBUG ((LOG_DEBUG, "sys_change_ifname: %s -> %s\n", old, new));
+
+    memset (&ifr, '\0', sizeof (ifr));
+    strlcpy(ifr.ifr_name, old, sizeof (ifr.ifr_name));
+    strlcpy(ifr.ifr_newname, new, sizeof (ifr.ifr_newname));
+
+#ifndef SIOCSIFNAME
+#define SIOCSIFNAME 0x8923
+#endif
+    if (ioctl(sock_fd, SIOCSIFNAME, (caddr_t) &ifr) < 0) {
+	if (errno = EEXIST)
+	    warn("Couldn't change name to %s as it is already in use", new);
+	else
+	    error("Couldn't change name from %s to %s: %m", old, new);
+	return 0;
+    }
+    return 1;
+}
Index: pppd/main.c
=================================RCS file: /var/cvs/snwb/packages/ppp/pppd/main.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- pppd/main.c	19 Nov 2002 04:09:41 -0000	1.6
+++ pppd/main.c	3 Dec 2002 00:44:18 -0000	1.7
@@ -529,8 +529,10 @@
 	fd_ppp = -1;
 	if (!hungup)
 	    lcp_lowerdown(0);
-	if (!demand)
+	if (!demand) {
 	    script_unsetenv("IFNAME");
+	    script_unsetenv("IFUNIT");
+	}
 
 	/*
 	 * Run disconnector script, if requested.
@@ -726,11 +728,13 @@
     int iskey;
 {
     slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
+    info("Using interface %s", ifname);
+    script_setenv("IFUNIT", ifname, iskey);
     if (req_ifname[0] && sys_change_ifname(ifname, req_ifname)) {
 	slprintf(ifname, sizeof(ifname), "%s", req_ifname);
+        info("Changing interface to %s", ifname);
     }
-    info("Using interface %s", ifname);
-    script_setenv("IFNAME", ifname, iskey);
+    script_setenv("IFNAME", ifname, 0);
     if (iskey) {
 	create_pidfile();	/* write pid to file */
 	create_linkpidfile();
Index: pppd/multilink.c
=================================RCS file: /var/cvs/snwb/packages/ppp/pppd/multilink.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- pppd/multilink.c	13 Mar 2001 05:54:34 -0000	1.1.1.1
+++ pppd/multilink.c	3 Dec 2002 00:44:18 -0000	1.2
@@ -158,7 +158,7 @@
 		rec = tdb_fetch(pppdb, pid);
 		if (rec.dptr != NULL) {
 			/* it is, parse the interface number */
-			parse_num(rec.dptr, "IFNAME=ppp", &unit);
+			parse_num(rec.dptr, "IFUNIT=ppp", &unit);
 			/* check the pid value */
 			if (!parse_num(rec.dptr, "PPPD_PID=", &pppd_pid)
 			    || !process_exists(pppd_pid)
@@ -224,7 +224,7 @@
 	TDB_DATA kd, vd;
 	int ret = 0;
 
-	slprintf(ifkey, sizeof(ifkey), "IFNAME=ppp%d", unit);
+	slprintf(ifkey, sizeof(ifkey), "IFUNIT=ppp%d", unit);
 	kd.dptr = ifkey;
 	kd.dsize = strlen(ifkey);
 	vd = tdb_fetch(pppdb, kd);
-
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-08-01 23:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2004-08-01 23:10 ` Herbert Xu

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