public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
* [git.ipfire.org] IPFire 3.x development tree branch, master, updated. cba4ea7b3e10ef8b96bb386389d947aa3e7763bd
@ 2014-12-27 20:37 git
  0 siblings, 0 replies; only message in thread
From: git @ 2014-12-27 20:37 UTC (permalink / raw)
  To: ipfire-scm

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

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 3.x development tree".

The branch, master has been updated
       via  cba4ea7b3e10ef8b96bb386389d947aa3e7763bd (commit)
      from  1d4cf0a3b6862f2a12d7c68e1c866bd8d9cd59a7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cba4ea7b3e10ef8b96bb386389d947aa3e7763bd
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date:   Sat Dec 27 20:36:31 2014 +0000

    ppp: Re-add ifname patch
    
    This is needed so that we can give zones a proper name
    instead of calling them ppp0 and so on.

-----------------------------------------------------------------------

Summary of changes:
 ppp/patches/ppp-2.4.2-ifname.patch | 126 +++++++++++++++++++++++++++++++++++++
 ppp/ppp.nm                         |   2 +-
 2 files changed, 127 insertions(+), 1 deletion(-)
 create mode 100644 ppp/patches/ppp-2.4.2-ifname.patch

Difference in files:
diff --git a/ppp/patches/ppp-2.4.2-ifname.patch b/ppp/patches/ppp-2.4.2-ifname.patch
new file mode 100644
index 0000000..50b96c9
--- /dev/null
+++ b/ppp/patches/ppp-2.4.2-ifname.patch
@@ -0,0 +1,126 @@
+--- ./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;
+ }
+ 
diff --git a/ppp/ppp.nm b/ppp/ppp.nm
index ea6f9c1..e12c68a 100644
--- a/ppp/ppp.nm
+++ b/ppp/ppp.nm
@@ -5,7 +5,7 @@
 
 name       = ppp
 version    = 2.4.6
-release    = 1
+release    = 2
 
 groups     = System/Daemons
 url        = http://ppp.samba.org/


hooks/post-receive
--
IPFire 3.x development tree

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-12-27 20:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-27 20:37 [git.ipfire.org] IPFire 3.x development tree branch, master, updated. cba4ea7b3e10ef8b96bb386389d947aa3e7763bd git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox