netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Amerigo Wang <amwang@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	Eric Dumazet <eric.dumazet@gmail.com>,
	linux-rdma@vger.kernel.org, netdev@vger.kernel.org,
	Neil Horman <nhorman@tuxdriver.com>,
	linux-sctp@vger.kernel.org, David Miller <davem@davemloft.net>
Subject: Re: [RFC Patch] net: reserve ports for applications using fixed port numbers
Date: Fri, 5 Feb 2010 08:11:29 +0100	[thread overview]
Message-ID: <e2e108261002042311w59ba1372ld9f8fb2f369ca434@mail.gmail.com> (raw)
In-Reply-To: <20100203043332.3817.27932.sendpatchset@localhost.localdomain>

On Wed, Feb 3, 2010 at 5:30 AM, Amerigo Wang <amwang@redhat.com> wrote:
>
> This patch introduces /proc/sys/net/ipv4/ip_local_reserved_ports,
> it can be used like ip_local_port_range, but this is used to
> reserve ports for third-party applications which use fixed
> port numbers within ip_local_port_range.
>
> This only affects the applications which call socket functions
> like bind(2) with port number 0, to prevent the kernel getting the ports
> within the specified range for them. For applications which use fixed
> port number, it will have no effects.
>
> Any comments are welcome.

Relying on fixed port numbers is generally considered as a shortcoming
in the application. It would be helpful if you could explain more in
detail why port number reservation is necessary. Maybe there exists
another solution that does not require modifying the bind() system
call.

A quote from the UNIX socket FAQ (http://www.faqs.org/faqs/unix-faq/socket/):

  4.10.  How should I choose a port number for my server?

  The list of registered port assignments can be found in STD 2 or RFC
  1700.  Choose one that isn't already registered, and isn't in
  /etc/services on your system.  It is also a good idea to let users
  customize the port number in case of conflicts with other un-
  registered port numbers in other servers.  The best way of doing this
  is hardcoding a service name, and using getservbyname() to lookup the
  actual port number.  This method allows users to change the port your
  server binds to by simply editing the /etc/services file.

Bart.

  parent reply	other threads:[~2010-02-05  7:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-03  4:30 [RFC Patch] net: reserve ports for applications using fixed port numbers Amerigo Wang
     [not found] ` <20100203043332.3817.27932.sendpatchset-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-02-03  4:39   ` Eric Dumazet
2010-02-03  5:15     ` Cong Wang
2010-02-03 11:12   ` Octavian Purdila
     [not found]     ` <201002031312.48531.opurdila-+zzKsuq53OdBDgjK7y7TUQ@public.gmane.org>
2010-02-04  3:23       ` Cong Wang
     [not found]         ` <4B6A3DBA.1000706-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-02-04 12:44           ` Octavian Purdila
     [not found]             ` <201002041444.01897.opurdila-+zzKsuq53OdBDgjK7y7TUQ@public.gmane.org>
2010-02-04 17:41               ` David Miller
     [not found]                 ` <20100204.094110.64247447.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2010-02-04 18:15                   ` Octavian Purdila
     [not found]                     ` <201002042015.51092.opurdila-+zzKsuq53OdBDgjK7y7TUQ@public.gmane.org>
2010-02-04 18:21                       ` David Miller
2010-02-04 21:45                       ` Tetsuo Handa
     [not found]                         ` <201002050645.CEC95380.MLOtOVFFHSFOQJ-JPay3/Yim36HaxMnTkn67Xf5DAMn2ifp@public.gmane.org>
2010-02-04 21:56                           ` David Miller
2010-02-05  0:41                             ` Tetsuo Handa
2010-02-05  1:05                               ` Octavian Purdila
2010-02-05  6:01                                 ` Cong Wang
2010-02-05 12:28                                   ` Octavian Purdila
2010-02-05  4:45                     ` Cong Wang
     [not found]                       ` <4B6BA272.4090405-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-02-05 12:05                         ` Octavian Purdila
     [not found]                           ` <201002051405.54029.opurdila-+zzKsuq53OdBDgjK7y7TUQ@public.gmane.org>
2010-02-08  3:21                             ` Cong Wang
     [not found]                               ` <4B6F834E.4010801-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-02-08 16:51                                 ` Octavian Purdila
2010-02-05  7:11 ` Bart Van Assche [this message]
2010-02-05  7:25   ` Cong Wang
2010-02-05  9:08     ` [RFC Patch] net: reserve ports for applications using fixed portnumbers Tetsuo Handa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e2e108261002042311w59ba1372ld9f8fb2f369ca434@mail.gmail.com \
    --to=bvanassche@acm.org \
    --cc=amwang@redhat.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).