Your message dated Thu, 07 Jan 2021 00:35:05 +0000
with message-id <[email protected]>
and subject line Bug#578726: fixed in ppp 2.4.9-1+1
has caused the Debian Bug report #578726,
regarding Subject: Add ppp option defaultroute-metric to specify an optional 
metric
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
578726: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578726
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: ppp
Version: 2.4.4rel-10.2
Severity: wishlist
Tags: patch


At the moment, with options defaultroute and replacedefaultroute, ppp
considers all default routes equally. If there is one, it will be left
alone or replaced, regardless of its metric.

The proposed patch allows to optionally specify a route metric to
1) set the metric on the default route going through the ppp device,
2) limit the search for existing default routes which may be replaced or
prevent pppd from setting its own.

The default value is -1, which triggers the normal (unpatched)
behaviour: checking for the presence of any default route, and possibly
replacing it. Setting the option to any value > 0 will have ppp limit
itself to checking default routes with this metric. If any is found,
pppd will depend on options defaultroute and replacedefaultroute to
decide what to do, as in the normal case.

My ppp-2.4.4rel-10.2 is just a local fork of ppp-2.4.4rel-10.1 including
the following patch.  It may have an impact on Bug#425163.

================ cifdefaultroute-metric.dif =======================
Default route metric

Define the metric of the default route and only add it if there
is no other default route with the same metric.  With the default
value of -1, the route is only added if there is no default route at
all.

This patch is to be applied on top of the replacedefaultroute patch
from Debian.

Olivier Mehani <[email protected]>
Index: ppp-2.4.4/pppd/options.c
===================================================================
--- ppp-2.4.4.orig/pppd/options.c       2010-04-22 17:04:46.000000000 +1000
+++ ppp-2.4.4/pppd/options.c    2010-04-22 17:04:58.000000000 +1000
@@ -121,6 +121,7 @@
 bool   dryrun;                 /* print out option values and exit */
 char   *domain;                /* domain name set by domain option */
 int    child_wait = 5;         /* # seconds to wait for children at exit */
+int    dfl_route_metric = -1;  /* metric of the default route to set over the 
PPP link */
 
 #ifdef MAXOCTETS
 unsigned int  maxoctets = 0;    /* default - no limit */
@@ -290,6 +291,10 @@
       "Set pathname of ip-down script",
       OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
 
+    { "defaultroute-metric", o_int, &dfl_route_metric,
+      "Metric to use for the default route (Linux only; -1 for default 
behavior)",
+      OPT_PRIV|OPT_LLIMIT|OPT_INITONLY, NULL, 0, -1 },
+
 #ifdef HAVE_MULTILINK
     { "multilink", o_bool, &multilink,
       "Enable multilink operation", OPT_PRIO | 1 },
Index: ppp-2.4.4/pppd/sys-linux.c
===================================================================
--- ppp-2.4.4.orig/pppd/sys-linux.c     2010-04-22 17:04:46.000000000 +1000
+++ ppp-2.4.4/pppd/sys-linux.c  2010-04-22 17:05:38.000000000 +1000
@@ -234,7 +234,7 @@
 static void close_route_table (void);
 static int open_route_table (void);
 static int read_route_table (struct rtentry *rt);
-static int defaultroute_exists (struct rtentry *rt);
+static int defaultroute_exists (struct rtentry *rt, int metric);
 static int get_ether_addr (u_int32_t ipaddr, struct sockaddr *hwaddr,
                           char *name, int namelen);
 static void decode_version (char *buf, int *version, int *mod, int *patch);
@@ -244,6 +244,8 @@
 
 extern u_char  inpacket_buf[]; /* borrowed from main.c */
 
+extern int dfl_route_metric;
+
 /*
  * SET_SA_FAMILY - set the sa_family field of a struct sockaddr,
  * if it exists.
@@ -1538,9 +1540,10 @@
 /********************************************************************
  *
  * defaultroute_exists - determine if there is a default route
+ * with the given metric (or negative for any)
  */
 
-static int defaultroute_exists (struct rtentry *rt)
+static int defaultroute_exists (struct rtentry *rt, int metric)
 {
     int result = 0;
 
@@ -1553,7 +1556,8 @@
 
        if (kernel_version > KVERSION(2,1,0) && SIN_ADDR(rt->rt_genmask) != 0)
            continue;
-       if (SIN_ADDR(rt->rt_dst) == 0L) {
+       if (SIN_ADDR(rt->rt_dst) == 0L && (metric < 0 ||
+                        (metric >= 0 && (rt->rt_metric + 1) == metric))) {
            result = 1;
            break;
        }
@@ -1614,16 +1618,16 @@
           are called again, we will delete the current default route
           and set the new default route in this function.
           - this is normally only the case the doing demand: */
-       if (defaultroute_exists(&tmp_rt))
+       if (defaultroute_exists(&tmp_rt, dfl_route_metric))
            del_rt = &tmp_rt;
-    } else if (defaultroute_exists(&old_def_rt) &&
+    } else if (defaultroute_exists(&old_def_rt, dfl_route_metric) &&
               strcmp(old_def_rt.rt_dev, ifname) != 0) {
        /* We did not yet replace an existing default route, let's
           check if we should save and replace a default route: */
        if (old_def_rt.rt_flags & RTF_GATEWAY) {
            if (!replace) {
-               error("not replacing existing default route via %I",
-                     SIN_ADDR(old_def_rt.rt_gateway));
+               error("not replacing existing default route via %I with metric 
%d",
+                     SIN_ADDR(old_def_rt.rt_gateway), dfl_route_metric);
                return 0;
            } else {
                /* we need to copy rt_dev because we need it permanent too: */
@@ -1631,20 +1635,22 @@
                strcpy(tmp_dev, old_def_rt.rt_dev);
                old_def_rt.rt_dev = tmp_dev;
 
-               notice("replacing old default route to %s [%I]",
-                       old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway));
+               notice("replacing old default route to %s [%I, metric %d]",
+                       old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway),
+                       dfl_route_metric);
                default_rt_repl_rest = 1;
                del_rt = &old_def_rt;
            }
        } else
-           error("not replacing existing default route through %s",
-                 old_def_rt.rt_dev);
+           error("not replacing existing default route through %s with metric 
%d",
+                 old_def_rt.rt_dev, dfl_route_metric);
     }
 
     memset (&rt, 0, sizeof (rt));
     SET_SA_FAMILY (rt.rt_dst, AF_INET);
 
     rt.rt_dev = ifname;
+    rt.rt_metric = dfl_route_metric + 1; /* +1 for binary compatibility */
 
     if (kernel_version > KVERSION(2,1,0)) {
        SET_SA_FAMILY (rt.rt_genmask, AF_INET);
@@ -1683,6 +1689,9 @@
     SET_SA_FAMILY (rt.rt_dst,     AF_INET);
     SET_SA_FAMILY (rt.rt_gateway, AF_INET);
 
+    rt.rt_dev = ifname;
+    rt.rt_metric = dfl_route_metric + 1; /* +1 for binary compatibility */
+
     if (kernel_version > KVERSION(2,1,0)) {
        SET_SA_FAMILY (rt.rt_genmask, AF_INET);
        SIN_ADDR(rt.rt_genmask) = 0L;
Index: ppp-2.4.4/pppd/pppd.8
===================================================================
--- ppp-2.4.4.orig/pppd/pppd.8  2010-04-22 17:04:46.000000000 +1000
+++ ppp-2.4.4/pppd/pppd.8       2010-04-22 17:04:58.000000000 +1000
@@ -126,6 +126,12 @@
 set and this flag is also set, pppd replaces an existing default route
 with the new default route.
 .TP
+.B defaultroute-metric
+Define the metric of the \fIdefaultroute\fR and only add (or replace
+if \fIreplacedefaultroute\fR is used) it if there is no other default
+route with the same metric.  With the default value of -1, the route
+is only added if there is no default route at all.
+.TP
 .B disconnect \fIscript
 Execute the command specified by \fIscript\fR, by passing it to a
 shell, after

-- System Information:
Debian Release: 5.0.4
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-web100-mipl-686 (SMP w/1 CPU core)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages ppp depends on:
ii  libc6                     2.7-18lenny2   GNU C Library: Shared libraries
ii  libpam-modules            1.0.1-5+lenny1 Pluggable Authentication Modules f
ii  libpam-runtime            1.0.1-5+lenny1 Runtime support for the PAM librar
ii  libpam0g                  1.0.1-5+lenny1 Pluggable Authentication Modules l
ii  libpcap0.8                0.9.8-5        system interface for user-level pa
ii  netbase                   4.34           Basic TCP/IP networking system
ii  procps                    1:3.2.7-11     /proc file system utilities

ppp recommends no packages.

Versions of packages ppp suggests:
ii  iptables                      1.4.2-6    administration tools for packet fi

-- no debconf information

Attachment: pgpEdwUlp8puw.pgp
Description: Cryptographic signature


--- End Message ---
--- Begin Message ---
Source: ppp
Source-Version: 2.4.9-1+1
Done: Chris Boot <[email protected]>

We believe that the bug you reported is fixed in the latest version of
ppp, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Chris Boot <[email protected]> (supplier of updated ppp package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Thu, 07 Jan 2021 00:10:29 +0000
Source: ppp
Architecture: source
Version: 2.4.9-1+1
Distribution: unstable
Urgency: medium
Maintainer: Chris Boot <[email protected]>
Changed-By: Chris Boot <[email protected]>
Closes: 477245 578726 710946 961462 968040 978396 978732 979255
Changes:
 ppp (2.4.9-1+1) unstable; urgency=medium
 .
   [ Samuel Thibault ]
   * Use merge request URLs.
   * Add comments from upstream for Nacked patches.
 .
   [ Chris Boot ]
   * New upstream release.
     - Adds defaultroute6 option. (Closes: #477245)
     - Adds defaultroute-metric option. (Closes: #578726)
     - Accepts Windows Server 2019 malformed messages. (Closes: #968040)
     - Fixes pppoe-discovery -U. (Closes: #961462)
   * Remove patches merged upstream (lots!) and refresh the rest.
   * d/ppp.symbols: update for the new version.
   * d/rules: adjust for renamed pppoe plugin.
   * d/ppp.lintian-overrides: update paths to plugins.
   * d/ppp.postinst: remove left-in debugging aid (set -x). (Closes: #978732)
   * Update d/watch to point at ftp.samba.org and add the signing key.
   * Freshen up the ip{,v6}-{up,down} scripts. (Closes: #710946)
 .
   [ Michael Biebl ]
   * Stop using deprecated systemd-resolve tool. (Closes: #979255)
 .
   [ наб ]
   * Add /etc/ppp/ip-pre-up and corresponding /etc/ppp/ip-pre-up.d.
    (Closes: #978396)
Checksums-Sha1:
 7f40e05424c7b96f3caf563dd810f9b900f7e086 2516 ppp_2.4.9-1+1.dsc
 56ba143f331f6436efa3a1d41c75691c828833ba 716165 ppp_2.4.9.orig.tar.gz
 143ecc9e1d167847cd2962627e2d31b4ff5b8a35 488 ppp_2.4.9.orig.tar.gz.asc
 342897b0dfa0dbcaa22a13add9425088ac939a7a 93128 ppp_2.4.9-1+1.debian.tar.xz
Checksums-Sha256:
 4b65e4f7aca6fe51a8c8a41c01ab10ff7791b92fc6768620ebfd1f7c9a6d1064 2516 
ppp_2.4.9-1+1.dsc
 f938b35eccde533ea800b15a7445b2f1137da7f88e32a16898d02dee8adc058d 716165 
ppp_2.4.9.orig.tar.gz
 9f5cc230f2b2d750135bee36ec8e3c86fbf76428b9fc66b11442c585c83398e6 488 
ppp_2.4.9.orig.tar.gz.asc
 226264682e5dd2cc876839572ae8d9e61db506686131be57dbd06fd6e4c09588 93128 
ppp_2.4.9-1+1.debian.tar.xz
Files:
 4b23c0599653674ac479260df8249fb1 2516 admin optional ppp_2.4.9-1+1.dsc
 c88153ae3d16ae114152cd3c15c7301d 716165 admin optional ppp_2.4.9.orig.tar.gz
 0013b594113fded6f3de226f92246961 488 admin optional ppp_2.4.9.orig.tar.gz.asc
 cd77f4b1992479b8910ecdec4c70192d 93128 admin optional 
ppp_2.4.9-1+1.debian.tar.xz

-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEakxNgo23DDPFqbsY1o29Dt2gqWQFAl/2UcNfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDZB
NEM0RDgyOERCNzBDMzNDNUE5QkIxOEQ2OERCRDBFRERBMEE5NjQRHGJvb3RjQGRl
Ymlhbi5vcmcACgkQ1o29Dt2gqWTXcg//RA+JFfhiQFbOySg4AEUlcGXQHVsDQXFi
ycYVUYxMjXPatWdhVcIFFVlVAnWVDl5gdPZWfQFBpmjDVtnjjMIuJzg7Wsm4RIdN
vlFwY5WaLlHo8c6WbMHpbGLKG+gKqjgMHKL8+i51FfcGxtt9V1s9U3UtJMsTa2iY
bafiuFeFTTW2ljKQPrJCZW/OhNEawKapK4JiSLrPW/Bd526qjcY8Tv8s1CcReT0C
Mim2kaMe4yUR71Hd5E/YjP3XqWR2EWEpRW7Dhzbx3lZ8vj6RkhECUHCABws5GVUE
5uxHugQRIT2OWNDoBidmTfTSdOBmd9ycBnfKGpXUc5G3LtZ6GQ7FPZEv01EHNgQ6
qzOK9cyx32OeKolu5n9UD5NFNS2VPBC3ljclogfA2SqkLmMMJFZeeC2bqQqxOFhu
MkvYV1J6Ya/tYaZpb9E4NI0KFbvP0RcUKQh1gRrfu7Zs8dJ6gecay3n5JsNkhxzU
tshuGXdsXaY3WuwE0J8RzenJcrUzdR4ug7Ttu0B7muVvydz8a6jBHECoAcQubKs0
Bpo/RbQwdf73nJXB8UkiFIo4/2aOpcShzed7BVYN9Q/pd2m0E+svUdZ9nv+0Ubz1
gA+GDGRz076KmLyg+IwjQXrmvDH661HyML+U9wUtGU0ZzeWreS1ufDrGNnGrajsl
NKxjaARU9ok=
=G8BA
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to