summaryrefslogtreecommitdiff
path: root/pppstats
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2016-08-23 16:10:21 +1000
committerPaul Mackerras <paulus@samba.org>2016-08-23 16:10:21 +1000
commitbbcdc4366bbee6c3f4e1ddda31e4eec8c1b3ccc2 (patch)
treec8953650f2a3090fba41929ef8662f4879284e53 /pppstats
parent733c00a6ce0244ba5003f4f71a014db8200a30fe (diff)
downloadppp-bbcdc4366bbee6c3f4e1ddda31e4eec8c1b3ccc2.tar.gz
pppd: allow use of arbitrary interface names
This is a modified version of a patch from openSUSE that enables PPP interfaces to be called arbitrary names, rather than simply pppX where X is the unit number. The modifications from the stock openSUSE patch are: - refresh patch on top of 018_ip-up_option.diff - fix a printf format-string vulnerability in pppd/main.c:set_ifunit() - clarify the pppd.8 manpage additions - patch pppstats/pppstats.c to query renamed interfaces without complaint Origin: SUSE Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=458646 Forwarded: no Reviewed-by: Chris Boot <bootc@debian.org> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Diffstat (limited to 'pppstats')
-rw-r--r--pppstats/pppstats.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/pppstats/pppstats.c b/pppstats/pppstats.c
index 6367988..46cb9c2 100644
--- a/pppstats/pppstats.c
+++ b/pppstats/pppstats.c
@@ -88,7 +88,6 @@ int aflag; /* print absolute values, not deltas */
int dflag; /* print data rates, not bytes */
int interval, count;
int infinite;
-int unit;
int s; /* socket or /dev/ppp file descriptor */
int signalled; /* set if alarm goes off "early" */
char *progname;
@@ -449,6 +448,7 @@ main(argc, argv)
{
int c;
#ifdef STREAMS
+ int unit;
char *dev;
#endif
@@ -506,11 +506,6 @@ main(argc, argv)
if (argc > 0)
interface = argv[0];
- if (sscanf(interface, PPP_DRV_NAME "%d", &unit) != 1) {
- fprintf(stderr, "%s: invalid interface '%s' specified\n",
- progname, interface);
- }
-
#ifndef STREAMS
{
struct ifreq ifr;
@@ -535,6 +530,11 @@ main(argc, argv)
}
#else /* STREAMS */
+ if (sscanf(interface, PPP_DRV_NAME "%d", &unit) != 1) {
+ fprintf(stderr, "%s: invalid interface '%s' specified\n",
+ progname, interface);
+ }
+
#ifdef __osf__
dev = "/dev/streams/ppp";
#else