Skip to content

Commit

Permalink
added mtu
Browse files Browse the repository at this point in the history
  • Loading branch information
Super-User committed Jun 30, 2020
1 parent 3127c63 commit bebb43f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/resolvers/solaris/ffi/functions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module Ioctl
extend FFI::Library
ffi_lib FFI::Library::LIBC
attach_function :ioctl_lifnum, :ioctl, [:int, :int, Facter::Resolvers::Solaris::Lifnum], :int
attach_function :ioctl_lifreq, :ioctl, [:int, :int, Facter::Resolvers::Solaris::Lifreq], :int
attach_function :ioctl_arpreq, :ioctl, [:int, :int, Facter::Resolvers::Solaris::Arpreq], :int
end
end
Expand Down
2 changes: 2 additions & 0 deletions lib/resolvers/solaris/ffi/structs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class Lifru < FFI::Union
:lifru_broadaddr, SockaddrStorage,
:lifru_token, SockaddrStorage,
:lifru_subnet, SockaddrStorage,
:lifru_flags, :uint64,
:lifru_metric, :int,
:pad, [:char, 80]
end

Expand Down
7 changes: 6 additions & 1 deletion lib/resolvers/solaris/networking_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ def load_macaddress(lifreq, res)
Facter::Resolvers::Solaris::SIOCGARP,
arp
)
binding.pry
ioctl2 = Facter::Resolvers::Solaris::Ioctl::ioctl_lifreq(
socket,
Facter::Resolvers::Solaris::SIOCGLIFMTU,
lifreq
)
#mtu lifreq[:lifr_lifru][:lifru_metric]
if ioctl == -1
@log.debug("Error! #{FFI::LastError.error}")
end
Expand Down

0 comments on commit bebb43f

Please sign in to comment.