Project

General

Profile

Actions

Feature #7476

closed

missing "IP_TRANSPARENT" constant for IP sockets.

Added by elico (Eliezer Croitoru) over 11 years ago. Updated almost 10 years ago.

Status:
Closed
Target version:
[ruby-core:50372]

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.

Actions #1

Updated by usa (Usaku NAKAMURA) over 11 years ago

  • Category set to ext
  • Status changed from Open to Assigned
  • Assignee set to akr (Akira Tanaka)
  • Target version set to 2.0.0
Actions #2

Updated by mame (Yusuke Endoh) about 11 years ago

  • Tracker changed from Bug to Feature

Looks a feature request.

--
Yusuke Endoh

Updated by ko1 (Koichi Sasada) about 11 years ago

  • Target version changed from 2.0.0 to 2.1.0

ping -> akr

Updated by akr (Akira Tanaka) about 11 years ago

2013/2/24 ko1 (Koichi Sasada) :

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

Updated by normalperson (Eric Wong) about 11 years ago

Tanaka Akira wrote:

2013/2/24 ko1 (Koichi Sasada) :

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).

Updated by akr (Akira Tanaka) about 11 years ago

2013/4/3 Eric Wong :

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

Updated by hsbt (Hiroshi SHIBATA) about 10 years ago

  • Target version changed from 2.1.0 to 2.2.0

Updated by akr (Akira Tanaka) almost 10 years 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. [ruby-core:50372] [Bug #7476]

Updated by akr (Akira Tanaka) almost 10 years ago

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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0