Re: IP Binding

From: Daniel Koepke (dkoepke@CALIFORNIA.COM)
Date: 11/16/97


On Sun, 16 Nov 1997, George wrote:

->That's icky, lets use the conversion function or write one to do it if
->inet_addr is not standard.

The only problem with inet_addr() is if it encounters an error.  It
returns -1 on error, which, unfortunately, is a valid IP address
(255.255.255.255).  This would generally be considered a problem.
inet_addr() is a part of BSD 4.3, and I know at least Linux adopted
it, but I don't know about any other operating systems; and I'm
fairly certain Winsock doesn't support it.

The inet_aton() function fixes the -1 error (it returns the binary
address in an in_addr structure); but the portability issue remains.
It'd probably be best to do as Jeremy did, and convert to binary data
(perhaps move it to a function as you suggested).

->Sounds like it would be useful to some people and not break anything else.

I can't imagine it being all that useful, but since it's rather
insignifigant, I don't see why it shouldn't be added.  The trouble is
in deciding how to implement it.  Just a config.c variable that
contains the IP in dot-notation form?

  /*
   * set to NULL to use INADDR_ANY (bind to all IP addresses this
   * server has), or set to the specific IP of this server that you
   * want to bind to in dot-notation form (e.g., "1.2.3.4")
   */
  char *bind_to = "1.2.3.4";

Hm...?


daniel koepke / dkoepke@california.com


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST