summaryrefslogtreecommitdiff
path: root/lib/ohai/plugins/linux/network.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ohai/plugins/linux/network.rb')
-rw-r--r--lib/ohai/plugins/linux/network.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/ohai/plugins/linux/network.rb b/lib/ohai/plugins/linux/network.rb
index 3d80a057..c6fa8859 100644
--- a/lib/ohai/plugins/linux/network.rb
+++ b/lib/ohai/plugins/linux/network.rb
@@ -1,5 +1,6 @@
#
# Author:: Adam Jacob (<adam@opscode.com>)
+# Author:: Chris Read <chris.read@gmail.com>
# Copyright:: Copyright (c) 2008 Opscode, Inc.
# License:: Apache License, Version 2.0
#
@@ -161,10 +162,16 @@ Ohai.plugin(:Network) do
net_counters[tmp_int][:tx][:queuelen] = $1
end
- if line =~ /vlan id (\d+)/
- tmp_id = $1
+ if line =~ /vlan id (\d+)/ or line =~ /vlan protocol ([\w\.]+) id (\d+)/
+ if $2
+ tmp_prot = $1
+ tmp_id = $2
+ else
+ tmp_id = $1
+ end
iface[tmp_int][:vlan] = Mash.new unless iface[tmp_int][:vlan]
iface[tmp_int][:vlan][:id] = tmp_id
+ iface[tmp_int][:vlan][:protocol] = tmp_prot if tmp_prot
vlan_flags = line.scan(/(REORDER_HDR|GVRP|LOOSE_BINDING)/)
if vlan_flags.length > 0