Project

General

Profile

Feature #13803

Add Socket::Ifaddr.vhid on supported platforms

Added by asomers (Alan Somers) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Target version:
-
[ruby-core:82336]

Description

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.getifaddrs[11].vhid
=> 99


Files

Ifaddr.vhid.patch (1.62 KB) Ifaddr.vhid.patch asomers (Alan Somers), 08/10/2017 08:36 PM

Associated revisions

Revision e7ddf878
Added by naruse (Yui NARUSE) over 1 year ago

Add Socket::Ifaddr.vhid on supported platforms [Feature #13803]

patched by Alan Somers

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 59702
Added by naruse (Yui NARUSE) over 1 year ago

Add Socket::Ifaddr.vhid on supported platforms [Feature #13803]

patched by Alan Somers

Revision 59702
Added by naruse (Yui NARUSE) over 1 year ago

Add Socket::Ifaddr.vhid on supported platforms [Feature #13803]

patched by Alan Somers

Revision 59702
Added by naruse (Yui NARUSE) over 1 year ago

Add Socket::Ifaddr.vhid on supported platforms [Feature #13803]

patched by Alan Somers

History

Updated by asomers (Alan Somers) over 1 year ago

  • Backport deleted (2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN)
  • ruby -v deleted (2.5.0dev)
  • Tracker changed from Bug to Feature

There was a copy/paste error in my transcript. It should've read

$ 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

Updated by akr (Akira Tanaka) over 1 year ago

Although I don't tested, it seems fine except the document should use Integer instead of Fixnum.

Updated by hsbt (Hiroshi SHIBATA) over 1 year ago

  • Assignee set to hsbt (Hiroshi SHIBATA)
  • Status changed from Open to Assigned
#4

Updated by naruse (Yui NARUSE) over 1 year ago

  • Status changed from Assigned to Closed

Applied in changeset trunk|r59702.


Add Socket::Ifaddr.vhid on supported platforms [Feature #13803]

patched by Alan Somers

Updated by hsbt (Hiroshi SHIBATA) over 1 year ago

I also confirmed to build success with FreeBSD 11.0-RELEASE-p1

Also available in: Atom PDF