diff options
| author | Kubilay Kocak <koobs@FreeBSD.org> | 2015-07-03 17:43:54 +0000 |
|---|---|---|
| committer | Kubilay Kocak <koobs@FreeBSD.org> | 2015-07-03 17:43:54 +0000 |
| commit | 38fbd72ba47fde4da72639a92b687e808fcb147f (patch) | |
| tree | 071b002e144a868fbb6cc0812653d56da97ece9f /net-mgmt/rancid/files/patch-bin__rancid.in | |
| parent | Update to 3.4.2 (diff) | |
net-mgmt/rancid: Fix IPv6 prefix-lists, ASR9001 output and foundry slowness
Back-port a patch from 3.2 to 2.3.8 to make ipv6 prefix-lists sort properly,
which is broken in perl >=5.18 due to hash randomisation changes
Fix ASR9001 XR, which updates 3 hard disk files on a regular basis
(uptime_cont, temp_cont, volt_cont), which causes excessive output noise.
Change timing parameters for foundry networks equipment (brocade) so that it
doesn't take eternity to make configuration changes on multiple switches.
PR: 200733
Submitted by: <nick foobar org>
Approved by: Janos Mohacsi <jmohacsi bsd hu> (maintainer)
Diffstat (limited to 'net-mgmt/rancid/files/patch-bin__rancid.in')
| -rw-r--r-- | net-mgmt/rancid/files/patch-bin__rancid.in | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/net-mgmt/rancid/files/patch-bin__rancid.in b/net-mgmt/rancid/files/patch-bin__rancid.in new file mode 100644 index 000000000000..328a6e4a1986 --- /dev/null +++ b/net-mgmt/rancid/files/patch-bin__rancid.in @@ -0,0 +1,45 @@ +--- bin/rancid.in.orig 2015-06-09 15:46:07.000000000 +0100 ++++ bin/rancid.in 2015-06-09 15:57:24.000000000 +0100 +@@ -162,13 +162,38 @@ + @sorted_lines; + } + +-# These two routines will sort based upon IP addresses ++# ipaddrval(IPaddr) converts and IPv4/v6 address to a string for comparison. + sub ipaddrval { +- my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#); +- $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0])); ++ my($a) = @_; ++ my($norder); ++ ++ if ($a =~ /:/) { ++ my($l); ++ if ($a =~ /\//) { ++ ($a, $l) = split(/\//, $a); ++ } else { ++ $l = 128; ++ } ++ $norder = inet_pton(AF_INET6, $a); ++ return unpack("H*", $norder) . unpack("H*", pack("C", $l)); ++ } else { ++ my($l); ++ if ($a =~ /\//) { ++ ($a, $l) = split(/\//, $a); ++ } else { ++ $l = 32; ++ } ++ $norder = inet_pton(AF_INET, $a); ++ return(unpack("H*", $norder) . unpack("H*", pack("C", $l))); ++ } ++ ++ # otherwise return the original key value, so as not to sort on null ++ return($_[0]); + } ++ ++# sortbyipaddr(IPaddr, IPaddr) compares two IPv4/v6 addresses like strcmp(). + sub sortbyipaddr { +- &ipaddrval($a) <=> &ipaddrval($b); ++ &ipaddrval($a) cmp &ipaddrval($b); + } + + # This routine parses "show version" |
