Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 296267 | Differences between
and this patch

Collapse All | Expand All

(-)ppp-2.4.4.orig/pppd/options.c (+5 lines)
Lines 94-99 Link Here
94
int	kdebugflag = 0;		/* Tell kernel to print debug messages */
94
int	kdebugflag = 0;		/* Tell kernel to print debug messages */
95
int	default_device = 1;	/* Using /dev/tty or equivalent */
95
int	default_device = 1;	/* Using /dev/tty or equivalent */
96
char	devnam[MAXPATHLEN];	/* Device name */
96
char	devnam[MAXPATHLEN];	/* Device name */
97
int defaultmetric = 0;		/* Metric of the default route */
97
bool	nodetach = 0;		/* Don't detach from controlling tty */
98
bool	nodetach = 0;		/* Don't detach from controlling tty */
98
bool	updetach = 0;		/* Detach once link is up */
99
bool	updetach = 0;		/* Detach once link is up */
99
int	maxconnect = 0;		/* Maximum connect time */
100
int	maxconnect = 0;		/* Maximum connect time */
Lines 289-294 Link Here
289
      "Number of seconds to wait for child processes at exit",
290
      "Number of seconds to wait for child processes at exit",
290
      OPT_PRIO },
291
      OPT_PRIO },
291
292
293
    { "defaultmetric", o_int, &defaultmetric,
294
      "The metric of the default route",
295
      OPT_LIMITS, 0, 32766 },
296
292
#ifdef HAVE_MULTILINK
297
#ifdef HAVE_MULTILINK
293
    { "multilink", o_bool, &multilink,
298
    { "multilink", o_bool, &multilink,
294
      "Enable multilink operation", OPT_PRIO | 1 },
299
      "Enable multilink operation", OPT_PRIO | 1 },
(-)ppp-2.4.4.orig/pppd/pppd.8 (+3 lines)
Lines 121-126 Link Here
121
This entry is removed when the PPP connection is broken.  This option
121
This entry is removed when the PPP connection is broken.  This option
122
is privileged if the \fInodefaultroute\fR option has been specified.
122
is privileged if the \fInodefaultroute\fR option has been specified.
123
.TP
123
.TP
124
.B defaultmetric \fIn
125
The metric of the default route configured by pppd; default is 0.
126
.TP
124
.B disconnect \fIscript
127
.B disconnect \fIscript
125
Execute the command specified by \fIscript\fR, by passing it to a
128
Execute the command specified by \fIscript\fR, by passing it to a
126
shell, after
129
shell, after
(-)ppp-2.4.4.orig/pppd/pppd.h (+1 lines)
Lines 276-281 Link Here
276
extern int	kdebugflag;	/* Tell kernel to print debug messages */
276
extern int	kdebugflag;	/* Tell kernel to print debug messages */
277
extern int	default_device;	/* Using /dev/tty or equivalent */
277
extern int	default_device;	/* Using /dev/tty or equivalent */
278
extern char	devnam[MAXPATHLEN];	/* Device name */
278
extern char	devnam[MAXPATHLEN];	/* Device name */
279
extern int defaultmetric;		/* Metric of the default route */
279
extern int	crtscts;	/* Use hardware flow control */
280
extern int	crtscts;	/* Use hardware flow control */
280
extern bool	modem;		/* Use modem control lines */
281
extern bool	modem;		/* Use modem control lines */
281
extern int	inspeed;	/* Input/Output speed requested */
282
extern int	inspeed;	/* Input/Output speed requested */
(-)ppp-2.4.4.orig/pppd/sys-linux.c (-1 / +9 lines)
Lines 1441-1447 Link Here
1441
FILE *route_fd = (FILE *) 0;
1441
FILE *route_fd = (FILE *) 0;
1442
static char route_buffer[512];
1442
static char route_buffer[512];
1443
static int route_dev_col, route_dest_col, route_gw_col;
1443
static int route_dev_col, route_dest_col, route_gw_col;
1444
static int route_flags_col, route_mask_col;
1444
static int route_flags_col, route_mask_col, route_metric_col;
1445
static int route_num_cols;
1445
static int route_num_cols;
1446
1446
1447
static int open_route_table (void);
1447
static int open_route_table (void);
Lines 1484-1489 Link Here
1484
    route_dest_col = 1;
1484
    route_dest_col = 1;
1485
    route_gw_col = 2;
1485
    route_gw_col = 2;
1486
    route_flags_col = 3;
1486
    route_flags_col = 3;
1487
    route_metric_col = 6;
1487
    route_mask_col = 7;
1488
    route_mask_col = 7;
1488
    route_num_cols = 8;
1489
    route_num_cols = 8;
1489
1490
Lines 1503-1508 Link Here
1503
		route_gw_col = col;
1504
		route_gw_col = col;
1504
	    else if (strcasecmp(q, "flags") == 0)
1505
	    else if (strcasecmp(q, "flags") == 0)
1505
		route_flags_col = col;
1506
		route_flags_col = col;
1507
	    else if (strcasecmp(q, "metric") == 0)
1508
		route_metric_col = col;
1506
	    else if (strcasecmp(q, "mask") == 0)
1509
	    else if (strcasecmp(q, "mask") == 0)
1507
		route_mask_col = col;
1510
		route_mask_col = col;
1508
	    else
1511
	    else
Lines 1545-1550 Link Here
1545
1548
1546
    rt->rt_flags = (short) strtoul(cols[route_flags_col], NULL, 16);
1549
    rt->rt_flags = (short) strtoul(cols[route_flags_col], NULL, 16);
1547
    rt->rt_dev   = cols[route_dev_col];
1550
    rt->rt_dev   = cols[route_dev_col];
1551
    rt->rt_metric = (short) strtoul(cols[route_metric_col], NULL, 16);
1548
1552
1549
    return 1;
1553
    return 1;
1550
}
1554
}
Lines 1567-1572 Link Here
1567
1571
1568
	if (kernel_version > KVERSION(2,1,0) && SIN_ADDR(rt->rt_genmask) != 0)
1572
	if (kernel_version > KVERSION(2,1,0) && SIN_ADDR(rt->rt_genmask) != 0)
1569
	    continue;
1573
	    continue;
1574
	if (rt->rt_metric != defaultmetric) /* consider only routes with the same metric */
1575
	    continue;
1570
	if (SIN_ADDR(rt->rt_dst) == 0L) {
1576
	if (SIN_ADDR(rt->rt_dst) == 0L) {
1571
	    result = 1;
1577
	    result = 1;
1572
	    break;
1578
	    break;
Lines 1637-1642 Link Here
1637
    SIN_ADDR(rt.rt_gateway) = gateway;
1643
    SIN_ADDR(rt.rt_gateway) = gateway;
1638
1644
1639
    rt.rt_flags = RTF_UP | RTF_GATEWAY;
1645
    rt.rt_flags = RTF_UP | RTF_GATEWAY;
1646
    rt.rt_metric = defaultmetric + 1; /* +1 for binary compatibility */
1640
    if (ioctl(sock_fd, SIOCADDRT, &rt) < 0) {
1647
    if (ioctl(sock_fd, SIOCADDRT, &rt) < 0) {
1641
	if ( ! ok_error ( errno ))
1648
	if ( ! ok_error ( errno ))
1642
	    error("default route ioctl(SIOCADDRT): %m");
1649
	    error("default route ioctl(SIOCADDRT): %m");
Lines 1670-1675 Link Here
1670
    SIN_ADDR(rt.rt_gateway) = gateway;
1677
    SIN_ADDR(rt.rt_gateway) = gateway;
1671
1678
1672
    rt.rt_flags = RTF_UP | RTF_GATEWAY;
1679
    rt.rt_flags = RTF_UP | RTF_GATEWAY;
1680
    rt.rt_metric = defaultmetric + 1; /* +1 for binary compatibility */
1673
    if (ioctl(sock_fd, SIOCDELRT, &rt) < 0 && errno != ESRCH) {
1681
    if (ioctl(sock_fd, SIOCDELRT, &rt) < 0 && errno != ESRCH) {
1674
	if (still_ppp()) {
1682
	if (still_ppp()) {
1675
	    if ( ! ok_error ( errno ))
1683
	    if ( ! ok_error ( errno ))

Return to bug 296267