[ruby-core:82336] [Ruby trunk Bug#13803] Add Socket::Ifaddr.vhid on supported platforms

From: asomers@...
Date: 2017-08-10 20:36:29 UTC
List: ruby-core #82336
Issue #13803 has been reported by asomers (Alan Somers).

----------------------------------------
Bug #13803: Add Socket::Ifaddr.vhid on supported platforms
https://bugs.ruby-lang.org/issues/13803

* Author: asomers (Alan Somers)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.5.0dev
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
VHIDs are used in the failover process for interfaces using the CARP protocol.  This patch adds support for getting the VHID of an interface address.  Tested on FreeBSD 11.0 and FreeBSD 12.0-CURRENT


$ sudo ifconfig epair create
$ sudo ifconfig epair0a 192.0.2.2/24 vhid 99
$ irb
> require 'socket'
> Socket.getifaddrs[11]
=> #<Socket::Ifaddr epair0a UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST 192.0.2.2 netmask=255.255.255.0 broadcast=192.0.2.255>
> Socket.getifaddrs[11].vhid
=> 99


---Files--------------------------------
Ifaddr.vhid.patch (1.62 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next