Your message dated Mon, 27 Jan 2014 23:33:34 +0000
with message-id <[email protected]>
and subject line Bug#458646: fixed in ppp 2.4.5+git20130610-4
has caused the Debian Bug report #458646,
regarding ppp: Please support arbitrary interface names [patch]
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
458646: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=458646
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Subject: ppp: Please support arbitrary interface names
Package: ppp
Version: 2.4.4rel-9
Severity: normal
Justification (for not being wishlist): because selectable interface names are 
becoming necessary on today's increasingly complex ADSL, UMTS; etc. 
configrations
Tags: patch, upstream

*** Please type your report below this line ***

Use of arbitrary and freely selectable network interface names both improves
manageability of systems with multiple interfaces (e.g. two "outgoing" ADSL
lines for upstream connection and multiple "incoming" L2TP/IPSec tunnels with
obviously very different settings/requirements) and makes firewalling much
easier. Although pppX interface names can be changed with 
"ip link set pppX name YYYY", e.g. in ip-up.d/ scripts, this solution is far 
from optimal because ppp itself gets confused when the current interface name
does not correspond to its internal "unit name". The most obvious breakage is
that statistics no longer get printed (e.g. to syslog) when terminating a
connection and that the CONNECT_TIME, BYTES_RCVD, and BYTES_SENT variables 
are not set for ip-down scripts. This makes accurate accounting and keeping
track of quota a lot harder.

I found the attached patch on the ppp mailing list archives from quite a while
ago and forward-ported it to ppp 2.4.4 with Debian specific patches taken into
consideration. It should apply cleanly when dropping the attached file into
debian/patches. When applied, the new option "ifname" can be used e.g. in
/etc/ppp/peers/YYY to set which interface name should be used for the specific
connection. This is complementary to the existing "linkname" option, which is 
not sufficient for clean interaction with firewalling, NAT, policy routing, 
IPSec, etc.
I have tested it on multiple systems with and without this option being used 
and found no issues at all (elthough I have not tried multilink, which the 
patch also seems to take care of). It will be used for all ppp versions in 
future Gibraltar releases.

Please consider applying it to future ppp packages.

best regards,
Rene

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (800, 'testing'), (300, 'unstable'), (100, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.22-3-686 (SMP w/1 CPU core)
Locale: LANG=de_AT.UTF-8, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages ppp depends on:
ii  libc6                         2.7-5      GNU C Library: Shared libraries
ii  libpam-modules                0.99.7.1-5 Pluggable Authentication Modules 
f
ii  libpam-runtime                0.99.7.1-5 Runtime support for the PAM 
librar
ii  libpam0g                      0.99.7.1-5 Pluggable Authentication Modules 
l
ii  libpcap0.8                    0.9.8-2    System interface for user-level 
pa
ii  netbase                       4.30       Basic TCP/IP networking system
ii  procps                        1:3.2.7-5  /proc file system utilities

ppp recommends no packages.

-- no debconf information
diff -urN ppp-2.4.4.orig/pppd/auth.c ppp-2.4.4/pppd/auth.c
--- ppp-2.4.4.orig/pppd/auth.c	Tue Jan  1 14:44:37 2008
+++ ppp-2.4.4/pppd/auth.c	Tue Jan  1 14:45:12 2008
@@ -647,8 +647,10 @@
     }
     if (!hungup)
 	lcp_lowerdown(0);
-    if (!doing_multilink && !demand)
+    if (!doing_multilink && !demand) {
 	script_unsetenv("IFNAME");
+        script_unsetenv("IFUNIT");
+    }
 
     /*
      * Run disconnector script, if requested.
diff -urN ppp-2.4.4.orig/pppd/main.c ppp-2.4.4/pppd/main.c
--- ppp-2.4.4.orig/pppd/main.c	Tue Jan  1 14:44:37 2008
+++ ppp-2.4.4/pppd/main.c	Tue Jan  1 14:45:12 2008
@@ -739,9 +739,14 @@
 set_ifunit(iskey)
     int iskey;
 {
-    info("Using interface %s%d", PPP_DRV_NAME, ifunit);
     slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
-    script_setenv("IFNAME", ifname, iskey);
+    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);
+    }
+    script_setenv("IFNAME", ifname, 0);
     if (iskey) {
 	create_pidfile(getpid());	/* write pid to file */
 	create_linkpidfile(getpid());
diff -urN ppp-2.4.4.orig/pppd/multilink.c ppp-2.4.4/pppd/multilink.c
--- ppp-2.4.4.orig/pppd/multilink.c	Tue Jan  1 14:44:37 2008
+++ ppp-2.4.4/pppd/multilink.c	Tue Jan  1 14:45:12 2008
@@ -204,7 +204,7 @@
 			/* make sure the string is null-terminated */
 			rec.dptr[rec.dsize-1] = 0;
 			/* 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)
@@ -417,7 +417,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);
diff -urN ppp-2.4.4.orig/pppd/options.c ppp-2.4.4/pppd/options.c
--- ppp-2.4.4.orig/pppd/options.c	Tue Jan  1 14:44:37 2008
+++ ppp-2.4.4/pppd/options.c	Tue Jan  1 14:46:03 2008
@@ -113,6 +113,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 */
 char	path_ipup[MAXPATHLEN];	/* pathname of ip-up script */
 char	path_ipdown[MAXPATHLEN];/* pathname of ip-down script */
 bool	multilink = 0;		/* Enable multilink operation */
@@ -273,6 +274,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 },
diff -urN ppp-2.4.4.orig/pppd/pppd.h ppp-2.4.4/pppd/pppd.h
--- ppp-2.4.4.orig/pppd/pppd.h	Tue Jan  1 14:44:37 2008
+++ ppp-2.4.4/pppd/pppd.h	Tue Jan  1 14:46:39 2008
@@ -312,6 +312,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 char	path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
 extern char	path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */
 extern bool	multilink;	/* enable multilink operation */
@@ -670,6 +671,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 */
diff -urN ppp-2.4.4.orig/pppd/sys-linux.c ppp-2.4.4/pppd/sys-linux.c
--- ppp-2.4.4.orig/pppd/sys-linux.c	Tue Jan  1 14:44:37 2008
+++ ppp-2.4.4/pppd/sys-linux.c	Tue Jan  1 14:45:12 2008
@@ -2931,4 +2931,29 @@
 
     return 1;
 }
 #endif
+
+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;
+}
+

Attachment: signature.asc
Description: This is a digitally signed message part.


--- End Message ---
--- Begin Message ---
Source: ppp
Source-Version: 2.4.5+git20130610-4

We believe that the bug you reported is fixed in the latest version of
ppp, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Chris Boot <[email protected]> (supplier of updated ppp package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Mon, 27 Jan 2014 22:17:11 +0000
Source: ppp
Binary: ppp ppp-udeb ppp-dev
Architecture: source amd64 all
Version: 2.4.5+git20130610-4
Distribution: unstable
Urgency: medium
Maintainer: Marco d'Itri <[email protected]>
Changed-By: Chris Boot <[email protected]>
Description: 
 ppp        - Point-to-Point Protocol (PPP) - daemon
 ppp-dev    - Point-to-Point Protocol (PPP) - development files
 ppp-udeb   - Point-to-Point Protocol (PPP) - package for Debian Installer 
(udeb)
Closes: 425163 458646 716864 727162
Changes: 
 ppp (2.4.5+git20130610-4) unstable; urgency=medium
 .
   * Remove obsolete --update-rcd-params from dh_installinit. (Closes: #727162)
   * Remove obsolete Build-Depends on quilt.
   * Add systemd service file for ppp-dns: (Closes: #716864)
     - Build-Depend on dh-systemd
     - Use dh_installinit --name instead of --init-script
     - Add dh_systemd_enable and dh_systemd_start to debian/rules
     Thanks to Shawn Landden for providing a patch.
   * Add LSB Description header to init script.
   * Make init script source /lib/lsb/init-functions for systemd compatibility.
   * Override a number of lintian tags:
     - init.d-script-does-not-implement-optional-option etc/init.d/pppd-dns
         status
     - non-standard-dir-perm etc/chatscripts/ and etc/ppp/peers/
     - package-contains-readme-for-other-platform-or-distro
         usr/share/doc/ppp/README.win9x
     - setuid-binary usr/sbin/pppd
     - debian-watch-may-check-gpg-signature
     See the lintian overrides files for reasoning.
   * Add support for arbitrary interface naming: (Closes: #458646)
     - Add debian/patches/ppp-2.4.2-ifname.diff based on openSUSE patch.
   * Fix a potential buffer overflow in the radius plugin:
     - Add debian/patches/ppp-2.4.4-strncatfix.patch from openSUSE.
   * Update debian/copyright:
     - Add myself to the list of maintainers
     - Change reference to GPL symlink license to GPL-2
   * Update Standards-Version to 3.9.5 (no changes required).
   * Refresh debian/patches/cifdefroute.dif from OpenSUSE (Closes: #425163) and
     add patch header.
Checksums-Sha1: 
 d2cd3dd15d7b6a7fa8fced4c1887c6530e9475ae 2180 ppp_2.4.5+git20130610-4.dsc
 738174b843991efa5caa73e37c5692e442b8d9f9 81556 
ppp_2.4.5+git20130610-4.debian.tar.xz
 b66ee6ed47daa91fb82912e2df14d56d799c02b9 330162 
ppp_2.4.5+git20130610-4_amd64.deb
 8753523036c97d83b52eadb3a03f460a2771bd78 118326 
ppp-udeb_2.4.5+git20130610-4_amd64.udeb
 f083240eff90f46a27398d2800c44b974b5728fd 54066 
ppp-dev_2.4.5+git20130610-4_all.deb
Checksums-Sha256: 
 953cb754656d6b723856548b125619174147833fac91fb4bb07098c788537520 2180 
ppp_2.4.5+git20130610-4.dsc
 58bc42b783bb3e9aad6551e743634e4357bad1d5439c443e20a911f748a5e2b2 81556 
ppp_2.4.5+git20130610-4.debian.tar.xz
 ab2568d5fefe5a836172bf0012dcc3f58c1b1e0a12b52d52ff335a2cbdce0c81 330162 
ppp_2.4.5+git20130610-4_amd64.deb
 dfe96d87eff18947f96d9fd99025762e52397f358bd374e42c228544e11498cc 118326 
ppp-udeb_2.4.5+git20130610-4_amd64.udeb
 68df52fc4ebf636d39ea608ecb0eb85d49b36aa24f1d399c94c8735868b807d6 54066 
ppp-dev_2.4.5+git20130610-4_all.deb
Files: 
 69ff8b9b1415a4add0addaa8a4aa6032 2180 admin optional 
ppp_2.4.5+git20130610-4.dsc
 24bc105ef53a93c1b9a3ce5f11e7f67f 81556 admin optional 
ppp_2.4.5+git20130610-4.debian.tar.xz
 3e76b1c735266218695d48faca731722 330162 admin optional 
ppp_2.4.5+git20130610-4_amd64.deb
 c82b560afd4f445348e3e7f4be5069af 118326 debian-installer optional 
ppp-udeb_2.4.5+git20130610-4_amd64.udeb
 710b59109e5ef1726d8afc9b6cf045ac 54066 devel extra 
ppp-dev_2.4.5+git20130610-4_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQJ8BAEBCgBmBQJS5usfXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxNjBCQzVCNDIwQjZGNUZCQTRCM0Q1MTBG
RTY4NTlEODdFQUU4QzgyAAoJEP5oWdh+royCrQgP/jgC4oXvffcVG20lECP07bxe
9VcDAYuEfCKpTytzGPUmPWDu2m9vcnZPNBWQcyYJpEFUfNHZX+6GYP3RLTOTNYeC
BkLdI4MuTfaGjOLN0w4o76gzJDHl8FD22Ontj/JlQvDUSIvAgBdpq0kcMGD+61H/
Z28dSM/7jpHBS7aKgS7/bJbZY9dPcPcamUAqNU9YAvD9AAWsUOCrvm3sIUPsN5Io
+dHzoGQzlnzU10+au0i+ZMszTCP+e2R4ZmtbNdh9EW5ihkv/iMhN/0uZrtBMtpPM
Q8sinb9xlXkRgH6VgQt0Gz9P0VjSinnnx3SCokA2IljOQBD8ZLr3ca55/vt8TJGz
4Fb+C3v2tlTZfcY2nV47zgGFH2K1pbarxgsAIY6FscDeGlapngAp5LofwswJXVms
hI6Uxr+x16uO8U1hH/iMHQnodDC7bCCfk5YQhKquc/ci9C3L+ts9cR/nIl7f8qxI
veNjy2iVLddEFduqjy9gUuAR3SpzgDawIaWetZRBMa9I8+s0DBE1TrB9aSdVDRcI
nP2JDjFMU0YjZZyyXyREI0RXwEUu3V9HqOSoLcr5Dt81SVbb1C/GxY66PAg4gZGr
52rL8sghn1BWPmKd2CksSfl/lchZ8K/de/J4tW4zicVJNh6R7GinfCXZa2VRAxAi
b7wNS1r9r5uFl5OhbMAl
=YrNm
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to