From fae4135fa802fb3cc51006eac35ec8825d03e5b5 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 15 Sep 2017 09:27:13 -0700 Subject: Fix the route support for IPV6 routes ending in :: Removing the ending word boundary in the regex allows is to capture the :: endings while still properly parsing other routes. I added a rubular comment as well so we know what this regex is actually trying to capture. Signed-off-by: Tim Smith --- lib/ohai/plugins/linux/network.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ohai/plugins/linux/network.rb b/lib/ohai/plugins/linux/network.rb index 32a89133..296941fb 100644 --- a/lib/ohai/plugins/linux/network.rb +++ b/lib/ohai/plugins/linux/network.rb @@ -104,7 +104,8 @@ Ohai.plugin(:Network) do route_entry = Mash.new(:destination => route_dest, :family => family[:name]) %w{via scope metric proto src}.each do |k| - route_entry[k] = $1 if route_ending =~ /\b#{k}\s+([^\s]+)\b/ + # http://rubular.com/r/pwTNp65VFf + route_entry[k] = $1 if route_ending =~ /\b#{k}\s+([^\s]+)/ end # a sanity check, especially for Linux-VServer, OpenVZ and LXC: -- cgit v1.2.1