Feature #7476

missing "IP_TRANSPARENT" constant for IP sockets.

Added by Eliezer Croitoru over 2 years ago. Updated 12 months ago.

[ruby-core:50372]
Status:Closed
Priority:Normal
Assignee:Akira Tanaka

Description

There is a missing constant for IP_TRANSPARENT on linux.
to set the TPROXY on a socket I use:
s.setsockopt(Socket::SOL_IP, 19, 1)
The 19 suppose to be as a constant named: IP_TRANSPARENT or Socket::IP_TRANSPARENT.

Associated revisions

Revision 45830
Added by Akira Tanaka 12 months ago

  • ext/socket/mkconstants.rb: Add IP_TRANSPARENT. IP_TRANSPARENT is provieded since glibc-2.12. Reported by Eliezer Croitoru. [Bug #7476]

Revision 45830
Added by Akira Tanaka 12 months ago

  • ext/socket/mkconstants.rb: Add IP_TRANSPARENT. IP_TRANSPARENT is provieded since glibc-2.12. Reported by Eliezer Croitoru. [Bug #7476]

History

#1 Updated by Usaku NAKAMURA over 2 years ago

  • Category set to ext
  • Status changed from Open to Assigned
  • Assignee set to Akira Tanaka
  • Target version set to 2.0.0

#2 Updated by Yusuke Endoh about 2 years ago

  • Tracker changed from Bug to Feature

Looks a feature request.

Yusuke Endoh mame@tsg.ne.jp

#3 Updated by Koichi Sasada about 2 years ago

  • Target version changed from 2.0.0 to 2.1.0

ping -> akr

#4 Updated by Akira Tanaka about 2 years ago

2013/2/24 ko1 (Koichi Sasada) redmine@ruby-lang.org:

Feature #7476: missing "IP_TRANSPARENT" constant for IP sockets.
https://bugs.ruby-lang.org/issues/7476#change-36913

There is a missing constant for IP_TRANSPARENT on linux.
to set the TPROXY on a socket I use:
s.setsockopt(Socket::SOL_IP, 19, 1)
The 19 suppose to be as a constant named: IP_TRANSPARENT or Socket::IP_TRANSPARENT.

This is Linux-specific and only defined in linux headers
such as /usr/include/linux/in.h.

I'm not sure applications can safely use such headers.
--
Tanaka Akira

#5 Updated by Eric Wong about 2 years ago

Tanaka Akira akr@fsij.org wrote:

2013/2/24 ko1 (Koichi Sasada) redmine@ruby-lang.org:

Feature #7476: missing "IP_TRANSPARENT" constant for IP sockets.
https://bugs.ruby-lang.org/issues/7476#change-36913

There is a missing constant for IP_TRANSPARENT on linux.
to set the TPROXY on a socket I use:
s.setsockopt(Socket::SOL_IP, 19, 1)
The 19 suppose to be as a constant named: IP_TRANSPARENT or Socket::IP_TRANSPARENT.

This is Linux-specific and only defined in linux headers
such as /usr/include/linux/in.h.

I'm not sure applications can safely use such headers.

We already have Linux-specific constants (e.g. TCP_CORK) and
*BSD-specific constants (e.g. TCP_NOPUSH), so I don't think we should
make it hard for users to take advantage of non-portable features on
their favorite OS.

I vote for adding IP_TRANSPARENT (and any other OS-specific constants
users request).

#6 Updated by Akira Tanaka about 2 years ago

2013/4/3 Eric Wong normalperson@yhbt.net:

This is Linux-specific and only defined in linux headers
such as /usr/include/linux/in.h.

I'm not sure applications can safely use such headers.

We already have Linux-specific constants (e.g. TCP_CORK) and
*BSD-specific constants (e.g. TCP_NOPUSH), so I don't think we should
make it hard for users to take advantage of non-portable features on
their favorite OS.

It is not my concern.
TCP_CORK is defined in /usr/include/netinet/tcp.h which is a glibc header.
--
Tanaka Akira

#7 Updated by Hiroshi SHIBATA about 1 year ago

  • Target version changed from 2.1.0 to current: 2.2.0

#8 Updated by Akira Tanaka 12 months ago

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

Applied in changeset r45830.


  • ext/socket/mkconstants.rb: Add IP_TRANSPARENT. IP_TRANSPARENT is provieded since glibc-2.12. Reported by Eliezer Croitoru. [Bug #7476]

#9 Updated by Akira Tanaka 12 months ago

It seems glibc-2.12 provides IP_TRANSPARENT.
So there is no problem to use it now.

Also available in: Atom PDF