Backport #8517

Enable IPV6_PKTINFO on OS X

Added by Eric Hodel almost 2 years ago. Updated almost 2 years ago.

[ruby-core:55453]
Status:Closed
Priority:Normal
Assignee:Usaku NAKAMURA

Description

=begin
Recent versions of OS X hide (({IPV6_PKTINFO})) (and some other socket options) behind (({APPLE_USE_RFC_3542})) (or (({APPLE_USE_RFC_2292}))).

This patch defines (({__APPLE_USE_RFC_3542})) when building the socket extension as netinet6/in6.h says "Note that eventually RFC 3542 is going to be the default and RFC 2292 will be obsolete."

With this patch IPV6_PKTINFO appears in Socket::Constants

=end

socket.apple_IPV6_PKTINFO.patch Magnifier (443 Bytes) Eric Hodel, 06/12/2013 11:25 AM

Associated revisions

Revision 41266
Added by Eric Hodel almost 2 years ago

  • ext/socket/extconf.rb: Enable RFC 3542 IPV6 socket options for OS X 10.7+. [ruby-trunk - Bug #8517]

Revision 41643
Added by Usaku NAKAMURA almost 2 years ago

merge revision(s) 41266: [Backport #8517]

* ext/socket/extconf.rb:  Enable RFC 3542 IPV6 socket options for OS X
  10.7+.  [ruby-trunk - Bug #8517]

History

#1 Updated by Eric Hodel almost 2 years ago

This patch does not work. __APPLE_USE_RFC_2292 does work, but I am unsure how the OS knows which socket options you wish to use.

#2 Updated by Eric Hodel almost 2 years ago

=begin
Oops, my previous comment was in error.

I was attempting to (({setsockopt :IPPROTO_IPV6, :IPV6_PKTINFO, true})) (RFC 2922) when you must set (({IPV6_RECVPKTINFO})) for an RFC 3542 implementation, so this patch is OK.
=end

#3 Updated by Yui NARUSE almost 2 years ago

  • Target version set to 2.1.0
  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN to 1.9.3: REQUIRED, 2.0.0: REQUIRED

/usr/include/netinet6/in6.h says

/*
* RFC 3542 define the following socket options in a manner incompatible
* with RFC 2292:
* IPV6_PKTINFO
* IPV6_HOPLIMIT
* IPV6_NEXTHOP
* IPV6_HOPOPTS
* IPV6_DSTOPTS
* IPV6_RTHDR
*
* To use the new IPv6 Sockets options introduced by RFC 3542
* the constant _APPLE_USE_RFC_3542 must be defined before
* including
*
* To use the old IPv6 Sockets options from RFC 2292
* the constant _APPLE_USERFC
2292 must be defined before
* including
*
* Note that eventually RFC 3542 is going to be the
* default and RFC 2292 will be obsolete.
*/

So commit it!

#4 Updated by Eric Hodel almost 2 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r41266.
Eric, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • ext/socket/extconf.rb: Enable RFC 3542 IPV6 socket options for OS X 10.7+. [ruby-trunk - Bug #8517]

#5 Updated by Tomoyuki Chikanaga almost 2 years ago

  • Project changed from Ruby trunk to Backport200
  • Target version deleted (2.1.0)
  • Assignee set to Tomoyuki Chikanaga
  • Status changed from Closed to Assigned
  • Tracker changed from Bug to Backport
  • Category deleted (ext)

#6 Updated by Tomoyuki Chikanaga almost 2 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r41320.
Eric, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 41266: [Backport #8517]

* ext/socket/extconf.rb:  Enable RFC 3542 IPV6 socket options for OS X
  10.7+.  [ruby-trunk - Bug #8517]

#7 Updated by Tomoyuki Chikanaga almost 2 years ago

  • Assignee changed from Tomoyuki Chikanaga to Usaku NAKAMURA
  • Status changed from Closed to Assigned
  • Project changed from Backport200 to Backport193

#8 Updated by Usaku NAKAMURA almost 2 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r41643.
Eric, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 41266: [Backport #8517]

* ext/socket/extconf.rb:  Enable RFC 3542 IPV6 socket options for OS X
  10.7+.  [ruby-trunk - Bug #8517]

Also available in: Atom PDF