From: Jesse Pollard <pollard@admin.navo.hpc.mil>
To: jt@hpl.hp.com, Jean Tourrilhes <jt@bougret.hpl.hp.com>,
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 13:09:35 -0600 [thread overview]
Message-ID: <200210311309.35451.pollard@admin.navo.hpc.mil> (raw)
In-Reply-To: <20021031183009.GB2972@bougret.hpl.hp.com>
On Thursday 31 October 2002 12:30 pm, Jean Tourrilhes wrote:
> 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.
Ummmmm... not quite the right answer - gethostbyname(hostname());
doesn't even have to return an IP number.
I have an environment right now that would make that result
useless. It is equivalent to using the 127.0.0.1 loopback.
We have a cluster where the address assgned to the hostname
is a nonroutable address, used only for internal communication
with other nodes in a cluster. The only way to get a "proper"
internet address is to request DNS for the address. And then
you might get back 35 addresses (would get 330 if the library
function would work properly).
It is also possible that NONE of the interfaces are assigned the
same name as the local host name. One of our environments
identifies a node by a frame/node construct. Addressing is
totally independant.
This association is only a convention, and is not something
mandatory.
Even at home, my systems have two or three addreses.
<external IP> applied to the firewall for external use
192.168.1.x for a small wireless network
192.168.0.x for the internal network
<external IP> for a dummy network device to make Kerberos work
192.168.2.x for a cluster network (some experimental systems).
The firewall has the first three, my workstation has the third and
fourth, and my toy cluster has the third and last.
There is no "node" IP number. Especially if you have more
than one network device.
--
-------------------------------------------------------------------------
Jesse I Pollard, II
Email: pollard@navo.hpc.mil
Any opinions expressed are solely my own.
next prev parent reply other threads:[~2002-10-31 19:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-31 18:09 How to get a local IPv4 address from within a kernel module? Juan Gomez
2002-10-31 18:30 ` Jean Tourrilhes
2002-10-31 18:57 ` Richard B. Johnson
2002-10-31 19:09 ` Jesse Pollard [this message]
-- 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=200210311309.35451.pollard@admin.navo.hpc.mil \
--to=pollard@admin.navo.hpc.mil \
--cc=jbm@blessed.joshisanerd.com \
--cc=jbm@joshisanerd.com \
--cc=jt@bougret.hpl.hp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.