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

(-)ppp-2.4.4-upto52/pppd/options.c (+4 lines)
Lines 119-124 Link Here
119
bool	tune_kernel;		/* may alter kernel settings */
119
bool	tune_kernel;		/* may alter kernel settings */
120
int	connect_delay = 1000;	/* wait this many ms after connect script */
120
int	connect_delay = 1000;	/* wait this many ms after connect script */
121
int	req_unit = -1;		/* requested interface unit */
121
int	req_unit = -1;		/* requested interface unit */
122
int	req_minunit = -1;	/* requested minimal interface unit */
122
char	req_ifname[MAXIFNAMELEN];	/* requested interface name */
123
char	req_ifname[MAXIFNAMELEN];	/* requested interface name */
123
bool	multilink = 0;		/* Enable multilink operation */
124
bool	multilink = 0;		/* Enable multilink operation */
124
char	*bundle_name = NULL;	/* bundle name for multilink */
125
char	*bundle_name = NULL;	/* bundle name for multilink */
Lines 287-292 Link Here
287
    { "unit", o_int, &req_unit,
288
    { "unit", o_int, &req_unit,
288
      "PPP interface unit number to use if possible",
289
      "PPP interface unit number to use if possible",
289
      OPT_PRIO | OPT_LLIMIT, 0, 0 },
290
      OPT_PRIO | OPT_LLIMIT, 0, 0 },
291
    { "minunit", o_int, &req_minunit,
292
      "PPP interface minimal unit number",
293
      OPT_PRIO | OPT_LLIMIT, 0, 0 },
290
294
291
    { "ifname", o_string, req_ifname,
295
    { "ifname", o_string, req_ifname,
292
      "Set PPP interface name",
296
      "Set PPP interface name",
(-)ppp-2.4.4-upto52/pppd/pppd.8 (+6 lines)
Lines 1051-1056 Link Here
1051
Set the ppp interface name for outbound connections.  A failure to set the
1051
Set the ppp interface name for outbound connections.  A failure to set the
1052
name will terminate the pppd.
1052
name will terminate the pppd.
1053
.TP
1053
.TP
1054
.B minunit \fInum
1055
Such as unit, but always select bigger interface
1056
.TP
1057
.B minunit \fInum
1058
PPP interface minimal unit number. Such as unit, but always select bigger interface
1059
.TP
1054
.B updetach
1060
.B updetach
1055
With this option, pppd will detach from its controlling terminal once
1061
With this option, pppd will detach from its controlling terminal once
1056
it has successfully established the ppp connection (to the point where
1062
it has successfully established the ppp connection (to the point where
(-)ppp-2.4.4-upto52/pppd/pppd.h (+2 lines)
Lines 87-92 Link Here
87
#define MAXARGS		1	/* max # args to a command */
87
#define MAXARGS		1	/* max # args to a command */
88
#define MAXNAMELEN	256	/* max length of hostname or name for auth */
88
#define MAXNAMELEN	256	/* max length of hostname or name for auth */
89
#define MAXSECRETLEN	256	/* max length of password or secret */
89
#define MAXSECRETLEN	256	/* max length of password or secret */
90
#define MAXUNIT		255	/* max ppp interface */
90
#define MAXIFNAMELEN	32	/* max length of interface name; or use IFNAMSIZ, can we
91
#define MAXIFNAMELEN	32	/* max length of interface name; or use IFNAMSIZ, can we
91
				   always include net/if.h? */
92
				   always include net/if.h? */
92
93
Lines 329-334 Link Here
329
extern int	connect_delay;	/* Time to delay after connect script */
330
extern int	connect_delay;	/* Time to delay after connect script */
330
extern int	max_data_rate;	/* max bytes/sec through charshunt */
331
extern int	max_data_rate;	/* max bytes/sec through charshunt */
331
extern int	req_unit;	/* interface unit number to use */
332
extern int	req_unit;	/* interface unit number to use */
333
extern int	req_minunit;	/* interface minimal unit number to use */
332
extern char	req_ifname[MAXIFNAMELEN];	/* interface name to use */
334
extern char	req_ifname[MAXIFNAMELEN];	/* interface name to use */
333
extern bool	multilink;	/* enable multilink operation */
335
extern bool	multilink;	/* enable multilink operation */
334
extern bool	noendpoint;	/* don't send or accept endpt. discrim. */
336
extern bool	noendpoint;	/* don't send or accept endpt. discrim. */
(-)ppp-2.4.4-upto52/pppd/sys-linux.c (-3 / +16 lines)
Lines 630-642 Link Here
630
	    || fcntl(ppp_dev_fd, F_SETFL, flags | O_NONBLOCK) == -1)
630
	    || fcntl(ppp_dev_fd, F_SETFL, flags | O_NONBLOCK) == -1)
631
		warn("Couldn't set /dev/ppp to nonblock: %m");
631
		warn("Couldn't set /dev/ppp to nonblock: %m");
632
632
633
	ifunit = req_unit;
633
	if (req_minunit > -1) {
634
	x = ioctl(ppp_dev_fd, PPPIOCNEWUNIT, &ifunit);
634
	    for(ifunit = req_minunit;req_minunit < MAXUNIT; ifunit = ++req_minunit) {
635
	if (x < 0 && req_unit >= 0 && errno == EEXIST) {
635
		x = ioctl(ppp_dev_fd, PPPIOCNEWUNIT, &ifunit);
636
		if (x < 0 && errno == EEXIST) {
637
		    warn("Couldn't allocate PPP unit %d as it is already in use try to attempt next", req_minunit);
638
		}
639
		if (x >= 0)
640
		    break;
641
	    }
642
	}
643
	if ((x < 0) || (req_minunit == -1)) {
644
	    ifunit = req_unit;
645
	    x = ioctl(ppp_dev_fd, PPPIOCNEWUNIT, &ifunit);
646
	    if (x < 0 && req_unit >= 0 && errno == EEXIST) {
636
		warn("Couldn't allocate PPP unit %d as it is already in use", req_unit);
647
		warn("Couldn't allocate PPP unit %d as it is already in use", req_unit);
637
		ifunit = -1;
648
		ifunit = -1;
638
		x = ioctl(ppp_dev_fd, PPPIOCNEWUNIT, &ifunit);
649
		x = ioctl(ppp_dev_fd, PPPIOCNEWUNIT, &ifunit);
650
	    }
639
	}
651
	}
652
640
	if (x < 0)
653
	if (x < 0)
641
		error("Couldn't create new ppp unit: %m");
654
		error("Couldn't create new ppp unit: %m");
642
655

Return to bug 9800