mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jean Tourrilhes <jt@bougret.hpl.hp.com>
To: Juan Gomez <juang@us.ibm.com>
Cc: Josh Myer <jbm@joshisanerd.com>,
	jbm@blessed.joshisanerd.com, linux-kernel@vger.kernel.org
Subject: Re: How to get a local IPv4 address from within a kernel module?
Date: Thu, 31 Oct 2002 10:30:09 -0800	[thread overview]
Message-ID: <20021031183009.GB2972@bougret.hpl.hp.com> (raw)
In-Reply-To: <OFA4AB1D53.AE6E9560-ON87256C63.006382A4@us.ibm.com>

On Thu, Oct 31, 2002 at 10:09:54AM -0800, Juan Gomez wrote:
> 
> Josh
> 
> That is the purpose of my orignal message. In fact I have implemented
> somthing along the lines of what you suggest below and I just want to test
> the waters on whether this will be accepted. My current implementation is a
> little more specific as it only gets the interfaces with IPv4 enabled on
> them and skip lo but the idea is to get a consensus on what would be
> genrally useful and then introduce that.
> 
> Regards, Juan

	I personally think it's a very bad idea, because it will lead
to confusion. You will define a concept of "the node IP address",
which doesn't exist and is a very dangerous assumption.
	Just take VPN, which is becoming very widespread. You have two
IP addresses, one on the interface, one on the tunnel. Which one do
you get ? Those two IP address will have widely different behaviour
and you can't exchange them.
	My fear is that people will start coding around this API and
flawed concept, and most of their programs will be immediately flawed,
because incapable to adapt to the reality of networking (it will work
in the simple case, but give bizarre behavior in non simple cases).
	Don't get me wrong, there is a small class of applications
where the IP address doesn't matter (and for those, 127.0.0.1 should
be fine). But, from my experience, the vast majority of people wanting
"the node IP address" have broken designs, i.e. it's not that they
want any one of them, it's that they assume that only one exist.

	Now, there is only one thing that could qualify as "the node
IP address", this is the IP address associated with the hostname :
		gethostbyname(hostname());
	IMHO, if you define the interface you are proposing, it should
always return the result above, because this is a well defined
semantic and it is more useful.

	But, I'm only one of the little guy here, so what I say
doesn't matter much. Ask Alan or DaveM.
	Regards,

	Jean

  reply	other threads:[~2002-10-31 18:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-31 18:09 Juan Gomez
2002-10-31 18:30 ` Jean Tourrilhes [this message]
2002-10-31 18:57   ` Richard B. Johnson
2002-10-31 19:09   ` Jesse Pollard
  -- strict thread matches above, loose matches on Subject: below --
2002-10-31 18:56 Juan Gomez
2002-10-31 17:32 Juan Gomez
2002-10-31 18:01 ` Josh Myer
2002-10-31  2:38 Jean Tourrilhes
2002-10-31  0:52 Juan Gomez

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=20021031183009.GB2972@bougret.hpl.hp.com \
    --to=jt@bougret.hpl.hp.com \
    --cc=jbm@blessed.joshisanerd.com \
    --cc=jbm@joshisanerd.com \
    --cc=jt@hpl.hp.com \
    --cc=juang@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®