Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: unblock
X-Debbugs-Cc: stay...@packages.debian.org
Control: affects -1 + src:stayrtr

Please unblock package stayrtr

The new upstream release contains only an important bug fix, needed to 
stop the daemon from crashing in specific conditions.
(This is the upstream bug report of a Debian user who was stuck with the 
version in testing: https://github.com/bgp/stayrtr/issues/96.)

diff attached, edited for clarity.

unblock stayrtr/0.5.1-1

-- 
ciao,
Marco
diff -Nru stayrtr-0.5.0/cmd/stayrtr/stayrtr.go 
stayrtr-0.5.1/cmd/stayrtr/stayrtr.go
--- stayrtr-0.5.0/cmd/stayrtr/stayrtr.go        2023-02-23 22:35:40.000000000 
+0100
+++ stayrtr-0.5.1/cmd/stayrtr/stayrtr.go        2023-03-01 15:36:19.000000000 
+0100
@@ -261,6 +261,38 @@
                vrplist = append(vrplist, vrp)
        }
 
+       sort.Slice(vrplist, func(i, j int) bool {
+               // Sort VRPs as per draft-ietf-sidrops-8210bis-10
+               /*
+                       11. ROA PDU Race Minimization
+                               When a cache is sending ROA (IPv4 or IPv6) PDUs 
to a router, especially an initial
+                               full load in response to a Reset Query PDU, two 
undesirable race conditions are possible:
+
+                       Break Before Make:
+                               For some prefix P, an AS may announce two (or 
more) ROAs because they are in the
+                               process of changing what provider AS is 
announcing P. This is a case of "make before break."
+                               If a cache is feeding a router and sends the 
one not yet in service a significant time
+                               before sending the one currently in service, 
then BGP data could be marked invalid during
+                               the interval. To minimize that interval, the 
cache SHOULD announce all ROAs for the same
+                               prefix as close to sequentially as possible.
+                       Shorter Prefix First:
+                               If an AS has issued a ROA for P0, and another 
AS (likely their customer) has issued a ROA
+                               for P1 which is a sub-prefix of P0, a router 
which receives the ROA for P0 before that for
+                               P1 is likely to mark a BGP prefix P1 invalid. 
Therefore, the cache SHOULD announce the
+                               sub-prefix P1 before the covering prefix P0.
+               */
+               CIDRSizei, _ := vrplist[i].Prefix.Mask.Size()
+               CIDRSizej, _ := vrplist[j].Prefix.Mask.Size()
+               if CIDRSizei == CIDRSizej {
+                       if vrplist[i].MaxLen != vrplist[j].MaxLen {
+                               return vrplist[i].MaxLen > vrplist[j].MaxLen
+                       }
+                       return bytes.Compare(vrplist[i].Prefix.IP, 
vrplist[j].Prefix.IP) < 1
+               } else {
+                       return CIDRSizei > CIDRSizej
+               }
+       })
+
        for _, v := range brklistjson {
                if v.Expires != nil {
                        // Prevent stale VRPs from being considered
@@ -299,7 +331,7 @@
                }
 
                // Ensure that these are sorted, otherwise they
-               // don't has right.
+               // don't hash right.
                sort.Slice(v.Providers, func(i, j int) bool {
                        return v.Providers[i] < v.Providers[j]
                })
diff -Nru stayrtr-0.5.0/cmd/stayrtr/stayrtr_test.go 
stayrtr-0.5.1/cmd/stayrtr/stayrtr_test.go
--- stayrtr-0.5.0/cmd/stayrtr/stayrtr_test.go   2023-02-23 22:35:40.000000000 
+0100
+++ stayrtr-0.5.1/cmd/stayrtr/stayrtr_test.go   2023-03-01 15:36:19.000000000 
+0100
@@ -103,11 +103,6 @@
        got, _, _, count, v4count, v6count := processData(stuff, nil, nil)
        want := []rtr.VRP{
                {
-                       Prefix: mustParseIPNet("192.168.0.0/24"),
-                       MaxLen: 24,
-                       ASN:    123,
-               },
-               {
                        Prefix: mustParseIPNet("2001:db8::/32"),
                        MaxLen: 33,
                        ASN:    123,
@@ -117,6 +112,11 @@
                        MaxLen: 25,
                        ASN:    123,
                },
+               {
+                       Prefix: mustParseIPNet("192.168.0.0/24"),
+                       MaxLen: 24,
+                       ASN:    123,
+               },
        }
        if count != 3 || v4count != 2 || v6count != 1 {
                t.Errorf("Wanted count = 3, v4count = 2, v6count = 1, but got 
%d, %d, %d", count, v4count, v6count)
diff -Nru stayrtr-0.5.0/debian/changelog stayrtr-0.5.1/debian/changelog
--- stayrtr-0.5.0/debian/changelog      2023-02-27 03:36:29.000000000 +0100
+++ stayrtr-0.5.1/debian/changelog      2023-03-05 01:11:49.000000000 +0100
@@ -1,3 +1,9 @@
+stayrtr (0.5.1-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Marco d'Itri <m...@linux.it>  Sun, 05 Mar 2023 01:11:49 +0100
+
 stayrtr (0.5.0-1) unstable; urgency=medium
 
   * New upstream release.
diff -Nru stayrtr-0.5.0/debian/patches/series 
stayrtr-0.5.1/debian/patches/series
--- stayrtr-0.5.0/debian/patches/series 2023-02-27 03:20:33.000000000 +0100
+++ stayrtr-0.5.1/debian/patches/series 1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-commit-8a3a71e
diff -Nru stayrtr-0.5.0/go.mod stayrtr-0.5.1/go.mod
--- stayrtr-0.5.0/go.mod        2023-02-23 22:35:40.000000000 +0100
+++ stayrtr-0.5.1/go.mod        2023-03-01 15:36:19.000000000 +0100
@@ -7,6 +7,6 @@
        github.com/prometheus/client_golang v1.11.1
        github.com/sirupsen/logrus v1.8.1
        github.com/stretchr/testify v1.4.0
-       golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
-       golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1
+       golang.org/x/crypto v0.6.0
+       golang.org/x/sys v0.5.0
 )

Attachment: signature.asc
Description: PGP signature

Reply via email to