net-dhcp 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 569c25c84f40f9720fa7095d7177159405e1bd78
4
- data.tar.gz: 87c70ad00d92788666bcf2f61558ef7d70dc18eb
3
+ metadata.gz: 7591159786b80d0d7445de33a57b99a4f51a635b
4
+ data.tar.gz: 575977fefba4c7a4dbe39d3e74a6c7e687fb9032
5
5
  SHA512:
6
- metadata.gz: f19be81874e45ac553dd689e4378482d8ee9279ef493463122e89ca7de85317e1bd9a9c9ee077488ec069f9f2f701e57d85766357e1094bf1e589049c82c5782
7
- data.tar.gz: 935f0bcdefef569905126c130f675869439d26953ce74a6f21ff2dd50b8c998ba7d8df4ddbace46ef0d683684a847fc50fb2a6286d357820d3969a2508ea09b4
6
+ metadata.gz: 0143ba28710c7902233e3931d358a9df245c07592201d2ae3137edb4c68c675df2f6392187c338ed571c6e63ca89efca817cf92ed702cf0a8a7a3b26c972f080
7
+ data.tar.gz: 8220cd139c0f5b967c1527c51a9473f26d184c496077561c5cc453a42fbc14d8805d4bd6974af4365d14778af85929cbb18ac22fa229f5a1710ed9affd2a629d
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ *1.3.2
2
+
3
+ * Fix MAC address sniffing under (at least) CentOS and RHEL 7 (also OS X and possibly FreeBSD)
4
+ (https://github.com/mjtko/net-dhcp-ruby/pull/11) [psschroeter]
5
+
1
6
  *1.3.1
2
7
 
3
8
  * Fix HostNameOption to use correct type (https://github.com/mjtko/net-dhcp-ruby/pull/9) [mordocai]
@@ -1,5 +1,5 @@
1
1
  module Net
2
2
  module Dhcp
3
- VERSION = "1.3.1"
3
+ VERSION = "1.3.2"
4
4
  end
5
5
  end
@@ -153,7 +153,11 @@ module DHCP
153
153
  mac = mac_line.strip.split(":")[1].gsub("-","").strip
154
154
  end
155
155
  else
156
- mac = `/sbin/ifconfig | grep HWaddr | cut -c39- | head -1`.chomp.strip.gsub(/:/,'')
156
+ ifcfg_out = `/sbin/ifconfig`.chomp
157
+ matches1 = ifcfg_out.scan(/HWaddr ([a-h0-9:]+)/i).flatten # Linux
158
+ matches2 = ifcfg_out.scan(/ether ([a-h0-9:]+)/i).flatten # Some Linux (EL7), BSDs
159
+ mac = matches1.first || matches2.first
160
+ mac = mac.gsub(/:/,"") if mac
157
161
  end
158
162
  mac = '000000000000' if mac.empty?
159
163
  self.chaddr = [mac].pack('H*').unpack('CCCCCC')
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
5
5
  s.name = 'net-dhcp'
6
6
  s.version = Net::Dhcp::VERSION
7
7
  s.platform = Gem::Platform::RUBY
8
- s.date = "2014-10-22"
8
+ s.date = "2014-11-18"
9
9
  s.authors = ['daniel martin gomez (etd)', 'syonbori', 'Mark J. Titorenko']
10
10
  s.email = 'mark.titorenko@alces-software.com'
11
11
  s.homepage = 'http://github.com/mjtko/net-dhcp-ruby'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-dhcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - daniel martin gomez (etd)
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-10-22 00:00:00.000000000 Z
13
+ date: 2014-11-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  version: 1.3.7
148
148
  requirements: []
149
149
  rubyforge_project:
150
- rubygems_version: 2.2.2
150
+ rubygems_version: 2.4.2
151
151
  signing_key:
152
152
  specification_version: 3
153
153
  summary: set of classes to low level handle the DHCP protocol