opscode/ohai — pull request #148 by jaymzh (2013-06-19 20:32:58+00:00)
Title: Handle IPv6 routes better

In IPv6 the linux kernel keeps cached routes in the global routing table. As
such running "ip -f inet6 route show" on a reasonably busy server that talks v6
to the internet will yield 10s or 100s of thousands of routes which ohai cannot
parse in a reasonable time/memory usage.

In reality the only things we should need however are the default route and the
local table.

This diff changes the code to look at the default route as well as the local
table.

Sadly, afaict in Ruby, if a function takes both args and a block, you cannot
pass a named Proc as your block, so I had to refactor a bit.