Frr null routes (#1622)

* net/frr: fix null route issue
* net/frr: version bump
* convert tab to spaces
This commit is contained in:
Fabian Franz BSc
2020-01-01 15:48:52 +01:00
committed by GitHub
parent a64f5fb371
commit 6c3d6f2152
4 changed files with 11 additions and 4 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
PLUGIN_NAME= frr
PLUGIN_VERSION= 1.13
PLUGIN_VERSION= 1.14
PLUGIN_COMMENT= The FRRouting Protocol Suite
PLUGIN_DEPENDS= frr6 ruby
PLUGIN_MAINTAINER= franz.fabian.94@gmail.com
+5
View File
@@ -11,6 +11,11 @@ switching and routing, Internet access routers, and Internet peering.
Plugin Changelog
================
1.14
* fix null route issue in parsing
* add missing via column to routing table for IPv4 (v6 already has it)
1.13
* Fix wrong match statement for IPv6 route-maps
@@ -36,6 +36,7 @@ POSSIBILITY OF SUCH DAMAGE.
<th data-column-id="ad" data-type="numeric">{{ lang._('Administrative Distance') }}</th>
<th data-column-id="metric" data-type="numeric">{{ lang._('Metric') }}</th>
<th data-column-id="interface" data-type="string">{{ lang._('Interface') }}</th>
<th data-column-id="via" data-type="string">{{ lang._('Via') }}</th>
<th data-column-id="time" data-type="string">{{ lang._('Time') }}</th>
</tr>
</thead>
@@ -51,6 +52,7 @@ POSSIBILITY OF SUCH DAMAGE.
<td><%= entry['ad'] %></td>
<td><%= entry['metric'] %></td>
<td><%= entry['interface'] %></td>
<td><%= entry['via'] %></td>
<td><%= entry['time'] %></td>
</tr>
<% }); %>
@@ -113,13 +113,13 @@ class General
end
# you don't have to understand this regex ;)
entry_regex = /(\S+?)\s+?(\S+?)(?: \[(\d+)\/(\d+)\])? (?:via (\S+?)|is ([^,]+?)), ([^,\n]+)(?:, (\S+))?/
entry_regex = /(\S+?)\s+?(\S+?)(?: \[(\d+)\/(\d+)\])? (?:(?:via (\S+?)|is ([^,]+?)|), ([^,\n]+)|(unreachable \(blackhole\)))(?:, (\S+))?/
entries = []
while (line = lines.shift&.strip)
if line.length > 10
code, network, ad, metric, via, direct, interface, time = line.scan(entry_regex).first
code, network, ad, metric, via, direct, interface, unreachable, time = line.scan(entry_regex).first
code = code.split('').map {|c| {short: c, long: meanings[c]}}
entries << {code: code, network: (network || direct), ad: ad, via: via, metric: metric, interface: interface, time: time }
entries << {code: code, network: (network || direct), ad: ad, via: via || unreachable, metric: metric, interface: interface, time: time }
end
end
entries