View | Details | Raw Unified | Return to bug 9800
Collapse All | Expand All

(-)ppp-2.4.2/pppd/options.c (+4 lines)
Lines 103-108 Link Here
103
bool	tune_kernel;		/* may alter kernel settings */
103
bool	tune_kernel;		/* may alter kernel settings */
104
int	connect_delay = 1000;	/* wait this many ms after connect script */
104
int	connect_delay = 1000;	/* wait this many ms after connect script */
105
int	req_unit = -1;		/* requested interface unit */
105
int	req_unit = -1;		/* requested interface unit */
106
int	req_minunit = -1;	/* requested minimal interface unit */
106
bool	multilink = 0;		/* Enable multilink operation */
107
bool	multilink = 0;		/* Enable multilink operation */
107
char	*bundle_name = NULL;	/* bundle name for multilink */
108
char	*bundle_name = NULL;	/* bundle name for multilink */
108
bool	dump_options;		/* print out option values */
109
bool	dump_options;		/* print out option values */
Lines 260-265 Link Here
260
    { "unit", o_int, &req_unit,
261
    { "unit", o_int, &req_unit,
261
      "PPP interface unit number to use if possible",
262
      "PPP interface unit number to use if possible",
262
      OPT_PRIO | OPT_LLIMIT, 0, 0 },
263
      OPT_PRIO | OPT_LLIMIT, 0, 0 },
264
    { "minunit", o_int, &req_minunit,
265
      "PPP interface minimal unit number",
266
      OPT_PRIO | OPT_LLIMIT, 0, 0 },
263
267
264
    { "dump", o_bool, &dump_options,
268
    { "dump", o_bool, &dump_options,
265
      "Print out option values after parsing all options", 1 },
269
      "Print out option values after parsing all options", 1 },
(-)ppp-2.4.2/pppd/pppd.8 (+3 lines)
Lines 1010-1015 Link Here
1010
Sets the ppp unit number (for a ppp0 or ppp1 etc interface name) for outbound
1010
Sets the ppp unit number (for a ppp0 or ppp1 etc interface name) for outbound
1011
connections.
1011
connections.
1012
.TP
1012
.TP
1013
.B minunit \fInum
1014
Such as unit, but always select bigger interface
1015
.TP
1013
.B updetach
1016
.B updetach
1014
With this option, pppd will detach from its controlling terminal once
1017
With this option, pppd will detach from its controlling terminal once
1015
it has successfully established the ppp connection (to the point where
1018
it has successfully established the ppp connection (to the point where
(-)ppp-2.4.2/pppd/pppd.h (+2 lines)
Lines 80-85 Link Here
80
#define MAXARGS		1	/* max # args to a command */
80
#define MAXARGS		1	/* max # args to a command */
81
#define MAXNAMELEN	256	/* max length of hostname or name for auth */
81
#define MAXNAMELEN	256	/* max length of hostname or name for auth */
82
#define MAXSECRETLEN	256	/* max length of password or secret */
82
#define MAXSECRETLEN	256	/* max length of password or secret */
83
#define MAXUNIT		255	/* max ppp interface */
83
84
84
/*
85
/*
85
 * Option descriptor structure.
86
 * Option descriptor structure.
Lines 304-309 Link Here
304
extern int	connect_delay;	/* Time to delay after connect script */
305
extern int	connect_delay;	/* Time to delay after connect script */
305
extern int	max_data_rate;	/* max bytes/sec through charshunt */
306
extern int	max_data_rate;	/* max bytes/sec through charshunt */
306
extern int	req_unit;	/* interface unit number to use */
307
extern int	req_unit;	/* interface unit number to use */
308
extern int	req_minunit;	/* interface minimal unit number to use */
307
extern bool	multilink;	/* enable multilink operation */
309
extern bool	multilink;	/* enable multilink operation */
308
extern bool	noendpoint;	/* don't send or accept endpt. discrim. */
310
extern bool	noendpoint;	/* don't send or accept endpt. discrim. */
309
extern char	*bundle_name;	/* bundle name for multilink */
311
extern char	*bundle_name;	/* bundle name for multilink */
(-)ppp-2.4.2/pppd/sys-linux.c (-3 / +16 lines)
Lines 638-650 Link Here
638
	    || fcntl(ppp_dev_fd, F_SETFL, flags | O_NONBLOCK) == -1)
638
	    || fcntl(ppp_dev_fd, F_SETFL, flags | O_NONBLOCK) == -1)
639
		warn("Couldn't set /dev/ppp to nonblock: %m");
639
		warn("Couldn't set /dev/ppp to nonblock: %m");
640
640
641
	ifunit = req_unit;
641
	if (req_minunit > -1) {
642
	x = ioctl(ppp_dev_fd, PPPIOCNEWUNIT, &ifunit);
642
	    for(ifunit = req_minunit;req_minunit < MAXUNIT; ifunit = ++req_minunit) {
643
	if (x < 0 && req_unit >= 0 && errno == EEXIST) {
643
		x = ioctl(ppp_dev_fd, PPPIOCNEWUNIT, &ifunit);
644
		if (x < 0 && errno == EEXIST) {
645
		    warn("Couldn't allocate PPP unit %d as it is already in use try to attempt next", req_minunit);
646
		}
647
		if (x >= 0)
648
		    break;
649
	    }
650
	}
651
	if ((x < 0) || (req_minunit == -1)) {
652
	    ifunit = req_unit;
653
	    x = ioctl(ppp_dev_fd, PPPIOCNEWUNIT, &ifunit);
654
	    if (x < 0 && req_unit >= 0 && errno == EEXIST) {
644
		warn("Couldn't allocate PPP unit %d as it is already in use", req_unit);
655
		warn("Couldn't allocate PPP unit %d as it is already in use", req_unit);
645
		ifunit = -1;
656
		ifunit = -1;
646
		x = ioctl(ppp_dev_fd, PPPIOCNEWUNIT, &ifunit);
657
		x = ioctl(ppp_dev_fd, PPPIOCNEWUNIT, &ifunit);
658
	    }
647
	}
659
	}
660
648
	if (x < 0)
661
	if (x < 0)
649
		error("Couldn't create new ppp unit: %m");
662
		error("Couldn't create new ppp unit: %m");
650
	return x;
663
	return x;
(-)ppp-2.4.2/pppd/pppd.8.orig (+3 lines)
Lines 1010-1015 Link Here
1010
Sets the ppp unit number (for a ppp0 or ppp1 etc interface name) for outbound
1010
Sets the ppp unit number (for a ppp0 or ppp1 etc interface name) for outbound
1011
connections.
1011
connections.
1012
.TP
1012
.TP
1013
.B minunit \fInum
1014
PPP interface minimal unit number. Such as unit, but always select bigger interface
1015
.TP
1013
.B updetach
1016
.B updetach
1014
With this option, pppd will detach from its controlling terminal once
1017
With this option, pppd will detach from its controlling terminal once
1015
it has successfully established the ppp connection (to the point where
1018
it has successfully established the ppp connection (to the point where

Return to bug 9800