Feature #7476
closed
missing "IP_TRANSPARENT" constant for IP sockets.
Added by elico (Eliezer Croitoru) about 12 years ago.
Updated over 10 years ago.
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.
- Category set to ext
- Status changed from Open to Assigned
- Assignee set to akr (Akira Tanaka)
- Target version set to 2.0.0
- Tracker changed from Bug to Feature
- Target version changed from 2.0.0 to 2.1.0
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
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).
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
- Target version changed from 2.1.0 to 2.2.0
- 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. [ruby-core:50372] [Bug #7476]
It seems glibc-2.12 provides IP_TRANSPARENT.
So there is no problem to use it now.
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0