Commit Graph

220 Commits

Author SHA1 Message Date
John Baldwin
183012b423 The API change mentioned in the previous revision has been backed out, so
back out the corresponding documentation.

Noticed by:	brian, ume
2000-08-22 21:50:03 +00:00
Hajimu UMEMOTO
2368b03bf4 Don't retry connecting via the same medium.
I changed to close to original code before merging IPv6 support.
It seems having delay before another try is useless.  However, I'm
not sure that delay means.  So, I leave it as-is.

PR:		bin/20515
2000-08-10 17:10:57 +00:00
Jun-ichiro itojun Hagino
1bf6f71909 mention getipnodeby* and get{addr,name}info are not thread-safe. (sync with kame)
s/.Os KAME/.Os/
comment From: Greg Thompson
2000-08-09 23:16:23 +00:00
Jason Evans
61e4108c41 Use _close() instead of close() in addrconfig() to keep it from becoming a
potential cancellation point in libc_r.
2000-07-21 04:22:39 +00:00
Hajimu UMEMOTO
c98e299e93 Copy canonname for *ahost, into static buffer.
Obtained from:	KAME Project
2000-07-20 18:49:35 +00:00
Brian Somers
732d07e535 Alocate rcmd{,_af}()'s *ahost argument using malloc() (well
strdup()) rather than pointing it at something that's free()d
(via freeaddrinfo(res)) before the function returns.

I appreciate that this is an API change, but it's the only way
(AFAIK) of doing this without breaking existing code that uses
rcmd{,_af}().

Pointed out by: phkmalloc
2000-07-20 09:05:15 +00:00
Hajimu UMEMOTO
05c36511b9 To define A RR to root (.) is valid in DNS. So, h_name = "" shouldn't
be treated as NULL.

PR:		bin/19816
Submitted by:	Bill Fenner <fenner@research.att.com>
Reviewed by:	Atsushi Onoe <onoe@sm.sony.co.jp>
2000-07-19 06:22:01 +00:00
Archie Cobbs
6e64168369 Const'ify parameters to ethers(3) routines as appropriate. 2000-07-18 22:44:52 +00:00
Peter Wemm
4a1afa49fd Try and fix the worst of some highly bogus malloc/free resource
management involving rcmd_af(), getaddrinfo(), freeaddrinfo(), etc.
We set *ahost to point to ai->canonname; and later free the ai-> stuff
and still leave the old pointers in *ahost to the freed data.
Perhaps the best way to deal with this is a static buffer or a static
strdup() that is freed on the next iteration or something.  This gives
me headaches just thinking about this.

The new 'AJ' default for malloc() tripped this up.
2000-07-11 09:31:19 +00:00
Jun-ichiro itojun Hagino
ec20fe00cc reject empty scopeid. use strtoul() for checking all-numericness of
portname.  explicitly reject empty numeric portname.
sync with kame.  based on comments from itohy@netbsd.org
2000-07-09 06:10:01 +00:00
Jun-ichiro itojun Hagino
024cdeff7a sync with more recent kame tree.
- correct scoped notation separator (s/@/%/)
- include example and more references
2000-07-05 08:27:50 +00:00
Jun-ichiro itojun Hagino
6cb9418289 sync with latest kame.
- permit numeric scopeid, be more careful about buffer size

TODO: 2nd arg type should be socklen_t for RFC2553 conformance,
but due to include file dependency it is not a easy thing to do
(netdb.h does not have socklen_t)
2000-07-05 05:09:17 +00:00
Jun-ichiro itojun Hagino
b826397abd sync with kame.
- better return code.  from enami@netbsd
- do not use "class" as variable name.  C++ guy had trouble with it.
2000-07-05 05:07:23 +00:00
Jun-ichiro itojun Hagino
23ba01423e add getifaddrs(3) from bsdi. this is a magic function which lets you grab
interface addresses in a portable manner, without headache of SIOCGIFCONF
or sysctl.  it is in bsdi/openbsd/netbsd already.
from kame tree (actually, mandatory for latest kame tree).
2000-07-05 02:13:17 +00:00
Kris Kennaway
3f587e572f Previous commit broke the case of chained CNAME entries. Instead handle
the bogus case by being stricter about errors.

Submitted by:   itojun
Obtained from:  KAME
2000-07-03 04:43:14 +00:00
Kris Kennaway
dc578f2564 Fix a nasty bug which would leave the struct hostent incompletely filled out
when parsing certain DNS records during a reverse address resolution. Thus
when code tries to examine the returned host name, it dereferences a null
pointer :-(

Problem noticed by:	ps
2000-07-03 02:33:02 +00:00
Hajimu UMEMOTO
a42af91cba Don't call _getipnodebyname_multi(). It fixes the problem that
getaddrinfo() accidentally returns IPv4 mapped IPv6 address instead
of native IPv4 address.
Now, getaddinfo() is scoped address ready.  You can put scoped
address within /etc/hosts.

Obtained from:	KAME Project.
2000-06-20 16:33:33 +00:00
Hajimu UMEMOTO
a40e8e8ba4 Re-commit DNS IPv6 transport support with fixes for IPv4 only
kernel and compatibility issue.

Obtained from:	KAME Project
2000-06-19 18:25:06 +00:00
Hajimu UMEMOTO
672315756a Backout my previous commit.
Cannot resolve any host on IPv4 only kernel.

Reported by:	ache
2000-06-14 20:51:55 +00:00
Hajimu UMEMOTO
7c381eb7d5 DNS IPv6 transport support.
It is nessesary for IPv6 only life.

Obtained from:	KAME
2000-06-11 15:43:34 +00:00
Tim Vanderhoek
0525c9d127 Fix an mdoc-o, and english. 2000-05-31 04:34:23 +00:00
Jake Burkholder
e39756439c Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others
2000-05-26 02:09:24 +00:00
Jake Burkholder
740a1973a6 Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd
2000-05-23 20:41:01 +00:00
Alexey Zelkin
cdbbbfa4fb . fix .Dt macro argument
. spell inet6_rthdr_reverse correctly
2000-05-12 10:07:31 +00:00
Sheldon Hearn
0f5fcaa3f1 Supply only one author name per instance of %A, as per mdoc.samples(7).
PR:		18465
Submitted by:	Kazu TAKAMUNE <takamune@avrl.mei.co.jp>
2000-05-10 09:49:04 +00:00
Jun-ichiro itojun Hagino
73b30f0cdf correct possible security issue(s) in name resolution, due to use of
pre-4.9.7 BIND resolver code.
ftp://ftp.kame.net/pub/mail-list/snap-users/2348 for details.

Reviewed by:	ume
2000-05-10 00:47:20 +00:00
Alexey Zelkin
03fc63031e Use `Er' variable to define first column width in ERRORS section. 2000-05-06 12:07:59 +00:00
Alexey Zelkin
25bb73e063 Introduce ".Lb" macro to libc manpages.
More libraries manpages updates following.
2000-04-21 09:42:15 +00:00
Yoshinobu Inoue
e6f35403c1 Change getaddrinfo() resolve order
from
  all AAAA trial, then all A trial
to
  try AAAA and A for each trial

TODO: more fix for the case where IPv4 mapped IPv6 addr is disabled

Reviewed by: ume
2000-04-20 03:31:40 +00:00
Jonathan Lemon
6134837824 Decrement the timeout being passed to poll() if poll was interrupted for
some reason.  This will prevent an infinite loop if (say) a sigalarm is
being scheduled at a more frequent interval than the poll timeout.

PR:	2191, 8847, 10553
2000-03-26 19:20:50 +00:00
Bruce Evans
84ee83efc7 Fixed missing #include of <sys/types.h> in synopsis.
Fixed spelling error in prototype for inet_option_space().
Fixed syntax error in prototype for inet6_option_alloc().
2000-03-23 16:29:05 +00:00
Bruce Evans
1025a2007f Fixed missing #include of <sys/types.h> in synopsis. 2000-03-23 16:20:20 +00:00
Brian S. Dean
a9f9141ca5 Back out that last commit, it may be insecure (pointed out by Warner
Losh).
2000-03-16 23:53:41 +00:00
Brian S. Dean
9c8e9b4a14 Slight adjustment to __ivaliduser() - don't ignore the last line in
the .rhosts file just because there is no ending linefeed.
2000-03-16 22:58:34 +00:00
Jonathan Lemon
38775c5e68 Fix uninitialized variable.
Submitted by:	tanimura
2000-03-15 15:04:54 +00:00
Yoshinobu Inoue
89482e464f Merge from NetBSD. Addition of inet_ntop() and inet_pton() description.
Specified by: Robert Muir <rmuir@looksharp.net>

Obtained from: NetBSD
2000-03-12 19:38:22 +00:00
Yoshinobu Inoue
375a501b7d Cosmetic fix. Re-order MLINKS for if_indextoname.3 and inet.3 as alphabetical
order.
2000-03-12 19:29:52 +00:00
Yoshinobu Inoue
95919b4418 Correct MLINKS contents for rcmd.3, because it is obsolete due to
recent changes to rcmd.3.

  links to iruserok_af.3, ruserok_af.3 are removed.
  link to iruserok_sa.3 is added.
2000-03-12 19:12:03 +00:00
Yoshinobu Inoue
2056d525db Import from KAME. Advanced API related function descriptions.
Obtained from: KAME project
2000-03-12 18:45:49 +00:00
Jonathan Lemon
638580129d Add in IPV4 NIS support.
PR:		17290 (but not the same patch)
Approved by:	jkh
2000-03-09 22:52:30 +00:00
Yoshinobu Inoue
265fb60da4 More grammer, wording, and mdoc fixes.
Submitted by: bde
Reviewed by: sheldonh
2000-03-09 16:41:27 +00:00
Yoshinobu Inoue
7d0d8dc306 CMSG_XXX macros alignment fixes to follow RFC2292.
Approved by: jkh

Submitted by: Partly from tech@openbsd
Reviewed by: itojun
2000-03-03 11:13:12 +00:00
Yoshinobu Inoue
a56a8ad111 -Reflect function name change.
-Added more description.
-Many grammer fix.
-Fix hard sentence break.
-Many other man style fix.

Thanks for bde finding out the problem.
Thanks for sheldon for the patient and thorough review.
:-)

Submitted by: bde
Reviewed by: sheldonh
2000-03-02 15:57:06 +00:00
Sheldon Hearn
c6ff3a1bf7 Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-02 09:14:21 +00:00
Yoshinobu Inoue
0ca229d64d Change IPv6 scoped addr format again based on recent standard discussion.
Sorry for the flapping, but no change will be done for 4.0 anymore.
Official standard will be published around April or later.
If different format would be adopted at that time, then support for
the new format will be added to the succeeding FreeBSD 4.x.

Approved by: jkh
2000-02-19 16:10:16 +00:00
Bill Fenner
686d0736aa Fix coredump in gethostbyaddr() when the returned answer is too large to
fit in the static buffer.  This fix causes it to look like there is no
 data available, which is also wrong but is better than dumping core.

PR:		bin/10344
Reviewed by:	billf
Approved by:	jkh
2000-02-16 04:39:00 +00:00
Yoshinobu Inoue
474ce1d190 Add more dual stack consideration.
-Should not error return when rresvport_af() failed for one of dest
     addrs resolved by getaddrinfo().
     Should retry until all dest addr fail.

Approved by: jkh
2000-02-10 19:46:47 +00:00
Yoshinobu Inoue
be26adb5b6 Let getaddrinfo() and related functions supports traditional IPv4 format
(shortend format, etc)

   Current KAME getaddrinfo() supports only d.d.d.d format IPv4
   addr. But traditionally inet_aton() and etc support other formats.
   (shortend format and octal/deciaml/hex format)
   Aboud this,
    -As far as the discussion on freebsd-current, many people
     think traditional format should also be supported by getaddrinfo().
    -X/Open spec requires getaddrinfo() also support those
     traditional IPv4 format.
    -RFC2553 say nothing about it.
    -As the result of confirmation in ietf/ipng list, there is
     no clear concensus yet, and the reply was, "RFC2553 update
     and X/Open spec will be in sync"

   So takeing these conditions into account, I think
   getaddrinfo() should also support traditional IPv4 format.

Specified by: Marc Schneiders <marc@oldserver.demon.nl>
Approved by: jkh
2000-02-10 02:59:50 +00:00
Yoshinobu Inoue
0db018f059 IPv6 scoped addr format is changed as recent KAME change.
KAME scoped addr format is changed recently.
     before:   addr@scope
     now:      scope%addr

   Because the end of IPv6 numeric addr is tend to be truncated in
   `netstat -rn ` output, so placing scope part at starting of addr
   will be convenient.

Approved by: jkh

Obtained from: KAME project
2000-02-09 00:38:06 +00:00
Yoshinobu Inoue
e3be4d7b7e sync iruserok() extension API with other BSDs
Some of rcmd related function is need to be updated to
  support IPv6. Some of them are already updated as standard
  document. But there is also several de-facto functions and
  they are not listed in standard documents.
  They are,

    iruserok()  (used by rlogind, rshd)
    ruserok()   (used by kerberos, etc)

  KAME package updated those functions in original way.

    iruserok_af()
    ruserok_af()

  But recently there was discussion on IETF IPng mailing
  list about how to sync those API, and it is decided,

    -Those function is not standard and not documented.
    -But let BSDs sync their API as de-facto.

  And after some discussion, it is announced that

    -add update to iruserok() as iruserok_sa()
    -no ruserok() API change(it is only updated internaly)

So I sync those API before 4.0 is released.
The changes are,
   -prototype changes
   -ruserok() internal update (use iruserok_sa() inside)
   -removal of ruserok_af()
   -change iruserok_af() as static functioin, and also prefix the name with __.
   -add iruserok_sa() (Just call __iruserok_af() inside)
   -adding flag AI_ALL to getipnodebyaddr() called from __icheckhost().
    This is necessary to support IPv4 communication via AF_INET6 socket
    could be correctly authenticated via iruserok_sa()
   -irusreok_af() call is replaced to iruserok_sa() call
    in rlogind, and rshd.

Approved by: jkh
2000-02-01 15:55:56 +00:00