Backport #8517

Enable IPV6_PKTINFO on OS X

Added by Eric Hodel 10 months ago. Updated 10 months ago.

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

Description

=begin
Recent versions of OS X hide (({IPV6PKTINFO})) (and some other socket options) behind (({APPLEUSERFC3542})) (or (({_APPLEUSERFC2292}))).

This patch defines (({_APPLEUSERFC3542})) 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 41643
Added by Usaku NAKAMURA 10 months 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 10 months ago

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

#2 Updated by Eric Hodel 10 months ago

=begin
Oops, my previous comment was in error.

I was attempting to (({setsockopt :IPPROTOIPV6, :IPV6PKTINFO, 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 10 months 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:
* IPV6PKTINFO
* IPV6
HOPLIMIT
* IPV6NEXTHOP
* IPV6
HOPOPTS
* IPV6DSTOPTS
* IPV6
RTHDR
*
* To use the new IPv6 Sockets options introduced by RFC 3542
* the constant _APPLEUSERFC3542 must be defined before
* including
*
* To use the old IPv6 Sockets options from RFC 2292
* the constant _APPLEUSERFC2292 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 10 months 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 10 months ago

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

#6 Updated by Tomoyuki Chikanaga 10 months 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 10 months ago

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

#8 Updated by Usaku NAKAMURA 10 months 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