Version in base suite: 1.1.1-3 Base version: prips_1.1.1-3 Target version: prips_1.1.1-3+deb11u1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/p/prips/prips_1.1.1-3.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/p/prips/prips_1.1.1-3+deb11u1.dsc changelog | 10 +++ patches/fix-different-cidr.patch | 106 +++++++++++++++++++++++++++++++++++++ patches/series | 2 patches/stop-at-last-address.patch | 46 ++++++++++++++++ 4 files changed, 164 insertions(+) diff -Nru prips-1.1.1/debian/changelog prips-1.1.1/debian/changelog --- prips-1.1.1/debian/changelog 2020-05-10 15:58:46.000000000 +0000 +++ prips-1.1.1/debian/changelog 2021-12-26 21:15:45.000000000 +0000 @@ -1,3 +1,13 @@ +prips (1.1.1-3+deb11u1) bullseye; urgency=medium + + * Add two patches from the 1.2.0 upstream version: + - stop-at-last-address: stop at 255.255.255.255 instead of wrapping + over to 0.0.0.0 and going on forever. Closes: #1001923 + - fix-different-cidr: fix the CIDR (-c) output when the addresses + differ in their very first bit. Closes: #1001924 + + -- Peter Pentchev Sun, 26 Dec 2021 23:15:45 +0200 + prips (1.1.1-3) unstable; urgency=medium * Declare compliance with Debian Policy 4.5.0 with no changes. diff -Nru prips-1.1.1/debian/patches/fix-different-cidr.patch prips-1.1.1/debian/patches/fix-different-cidr.patch --- prips-1.1.1/debian/patches/fix-different-cidr.patch 1970-01-01 00:00:00.000000000 +0000 +++ prips-1.1.1/debian/patches/fix-different-cidr.patch 2021-12-26 21:15:45.000000000 +0000 @@ -0,0 +1,106 @@ +Description: CIDR mode: handle "totally different" correctly. + If the addresses differ in their very first bit, report "0.0.0.0/0" + instead of the incorrect "x.y.z.t/32". +Bug-Debian: https://bugs.debian.org/1001924 +Origin: upstream, https://gitlab.com/prips/prips/-/commit/1afd3e6976f946317f3ac9980685549b5216a6f5 +Author: Peter Pentchev +Last-Updated: 2021-12-26 + +--- /dev/null ++++ b/t/06-cidrize.t +@@ -0,0 +1,74 @@ ++#!/bin/sh ++# ++# Copyright (c) 2021 Peter Pentchev ++# All rights reserved. ++# ++# Redistribution and use in source and binary forms, with or without ++# modification, are permitted provided that the following conditions ++# are met: ++# 1. Redistributions of source code must retain the above copyright ++# notice, this list of conditions and the following disclaimer. ++# 2. Redistributions in binary form must reproduce the above copyright ++# notice, this list of conditions and the following disclaimer in the ++# documentation and/or other materials provided with the distribution. ++# ++# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++# SUCH DAMAGE. ++ ++if [ -f 'tap-functions.sh' ]; then ++ . tap-functions.sh ++elif [ -f 't/tap-functions.sh' ]; then ++ . t/tap-functions.sh ++else ++ echo 'Bail out! Could not find tap-functions.sh' ++ exit 99 ++fi ++ ++[ -z "$PRIPS" ] && PRIPS='./prips' ++ ++plan_ 12 ++ ++v=`$PRIPS -c 127.0.0.0 127.0.0.7 2>/dev/null` ++res="$?" ++exp='127.0.0.0/29' ++if [ "$res" = 0 ]; then ok_; else not_ok_ "exit code $res"; fi ++if [ "$v" = "$exp" ]; then ok_; else not_ok_ "expected $exp got $v"; fi ++ ++v=`$PRIPS -c 127.0.0.2 127.0.0.6 2>/dev/null` ++res="$?" ++exp='127.0.0.0/29' ++if [ "$res" = 0 ]; then ok_; else not_ok_ "exit code $res"; fi ++if [ "$v" = "$exp" ]; then ok_; else not_ok_ "expected $exp got $v"; fi ++ ++v=`$PRIPS -c 127.0.0.0 127.0.0.9 2>/dev/null` ++res="$?" ++exp='127.0.0.0/28' ++if [ "$res" = 0 ]; then ok_; else not_ok_ "exit code $res"; fi ++if [ "$v" = "$exp" ]; then ok_; else not_ok_ "expected $exp got $v"; fi ++ ++v=`$PRIPS -c 192.168.17.42 192.168.18.3 2>/dev/null` ++res="$?" ++exp='192.168.16.0/22' ++if [ "$res" = 0 ]; then ok_; else not_ok_ "exit code $res"; fi ++if [ "$v" = "$exp" ]; then ok_; else not_ok_ "expected $exp got $v"; fi ++ ++v=`$PRIPS -c 10.21.33.4 10.21.33.4 2>/dev/null` ++res="$?" ++exp='10.21.33.4/32' ++if [ "$res" = 0 ]; then ok_; else not_ok_ "exit code $res"; fi ++if [ "$v" = "$exp" ]; then ok_; else not_ok_ "expected $exp got $v"; fi ++ ++v=`$PRIPS -c 10.21.33.4 210.21.33.4 2>/dev/null` ++res="$?" ++exp='0.0.0.0/0' ++if [ "$res" = 0 ]; then ok_; else not_ok_ "exit code $res"; fi ++if [ "$v" = "$exp" ]; then ok_; else not_ok_ "expected $exp got $v"; fi +--- a/prips.c ++++ b/prips.c +@@ -68,7 +68,7 @@ + /**********************************************/ + const char *cidrize(const uint32_t start, const uint32_t end) + { +- int offset = 0; ++ int offset = 32; + + /* find the mask (offset) by finding the + * highest bit set differently in the start +@@ -87,6 +87,9 @@ + diff = diff >> 1; + } + ++ if (offset == 32) ++ return "0.0.0.0/0"; ++ + /* clear out the bits below the mask */ + const uint32_t base = (start >> offset) << offset; + diff -Nru prips-1.1.1/debian/patches/series prips-1.1.1/debian/patches/series --- prips-1.1.1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ prips-1.1.1/debian/patches/series 2021-12-26 21:15:45.000000000 +0000 @@ -0,0 +1,2 @@ +stop-at-last-address.patch +fix-different-cidr.patch diff -Nru prips-1.1.1/debian/patches/stop-at-last-address.patch prips-1.1.1/debian/patches/stop-at-last-address.patch --- prips-1.1.1/debian/patches/stop-at-last-address.patch 1970-01-01 00:00:00.000000000 +0000 +++ prips-1.1.1/debian/patches/stop-at-last-address.patch 2021-12-26 21:15:45.000000000 +0000 @@ -0,0 +1,46 @@ +Description: Fix stopping at 255.255.255.255. +Bug-Debian: https://bugs.debian.org/1001923 +Origin: upstream, https://gitlab.com/prips/prips/-/commit/172f71f6803ba5b1212e8ffecccb013ee4adf40b +Author: Peter Pentchev +Last-Updated: 2021-12-26 + +--- a/main.c ++++ b/main.c +@@ -172,7 +172,7 @@ + printf("%s%c", cidrize(start, end), delimiter); + else + { +- for(uint32_t current = start; current <= end; current += increment) ++ for(uint32_t current = start; current <= end && current >= start; current += increment) + { if(!exception_flag || !except(¤t, octet, increment)) + { + switch(format) +--- a/t/02-range.t ++++ b/t/02-range.t +@@ -1,6 +1,6 @@ + #!/bin/sh + # +-# Copyright (c) 2016 Peter Pentchev ++# Copyright (c) 2016, 2021 Peter Pentchev + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without +@@ -35,7 +35,7 @@ + + [ -z "$PRIPS" ] && PRIPS='./prips' + +-plan_ 7 ++plan_ 9 + + echo '# prips with no arguments should exit with code 1' + $PRIPS > /dev/null 2>&1 +@@ -58,3 +58,9 @@ + res="$?" + if [ "$res" = 1 ]; then ok_; else not_ok_ "exit code $res"; fi + if [ -z "$v" ]; then ok_; else not_ok_ "expected $exp got $v"; fi ++ ++v=`$PRIPS -d33 255.255.255.252/30 2>/dev/null` ++res="$?" ++exp='255.255.255.252!255.255.255.253!255.255.255.254!255.255.255.255!' ++if [ "$res" = 0 ]; then ok_; else not_ok_ "exit code $res"; fi ++if [ "$v" = "$exp" ]; then ok_; else not_ok_ "expected $exp got $v"; fi