Feature #7476

missing "IP_TRANSPARENT" constant for IP sockets.

Added by Eliezer Croitoru over 1 year ago. Updated 3 months ago.

[ruby-core:50372]
Status:Assigned
Priority:Normal
Assignee:Akira Tanaka
Category:ext
Target version:current: 2.2.0

Description

There is a missing constant for IPTRANSPARENT 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: IPTRANSPARENT or Socket::IPTRANSPARENT.

History

#1 Updated by Usaku NAKAMURA over 1 year 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 1 year ago

  • Tracker changed from Bug to Feature

Looks a feature request.

Yusuke Endoh mame@tsg.ne.jp

#3 Updated by Koichi Sasada about 1 year ago

  • Target version changed from 2.0.0 to 2.1.0

ping -> akr

#4 Updated by Akira Tanaka about 1 year 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 IPTRANSPARENT 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: IPTRANSPARENT or Socket::IPTRANSPARENT.

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 1 year 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 IPTRANSPARENT 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: IPTRANSPARENT or Socket::IPTRANSPARENT.

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. TCPCORK) 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 1 year 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. TCPCORK) 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 3 months ago

  • Target version changed from 2.1.0 to current: 2.2.0

Also available in: Atom PDF