Commit Graph

803 Commits

Author SHA1 Message Date
Joel Dahl
478c2636bb Minor indentation and paragraph nits. 2012-03-27 20:39:49 +00:00
Joel Dahl
46355096e1 mdoc: correct .Bd/.Bl arguments.
Reviewed by:	brueffer
2012-03-26 21:22:53 +00:00
Joel Dahl
41949a1ed5 Remove superfluous paragraph macro. 2012-03-25 12:13:24 +00:00
Eitan Adler
6210106152 draft-ietf-ipv6-scoping-arch-02.txt is now RFC 4007
PR:		docs/163771
Submitted by:	phk
Reviewed by:	If someone else reviewed your modification.
Approved by:	cperciva
MFC after:	1 week
2012-03-19 00:47:01 +00:00
Ed Schouten
6b99842ada Globally replace u_int*_t from (non-contributed) man pages.
The reasoning behind this, is that if we are consistent in our
documentation about the uint*_t stuff, people will be less tempted to
write new code that uses the non-standard types.

I am not going to bump the man page dates, as these changes can be
considered style nits. The meaning of the man pages is unaffected.

MFC after:	1 month
2012-02-12 18:29:56 +00:00
Bjoern A. Zeeb
ca1672da93 Switch getifaddrs(3) to the new API introduced in r231505. Also remove
conditional code parts not used by or applicable to FreeBSD.

The new implementation is supposed to be able to cope with changes to
the 'l' versions of the msghdr structs now used as well as to if_data
allowing future changes without breaking things.

This restores carp(4) config support in HEAD after r231504.

Reviewed by:	glebius, brooks
MFC After:	3 months
2012-02-11 06:05:40 +00:00
Bjoern A. Zeeb
e82cf13bfb Backout changes from r228571. Remove if_data from struct ifa_msghdr again.
While this breaks carp on HEAD temporary, it restores the upgrade path from
stable, and head before 20111215.

Reviewed by:	glebius, brooks
2012-02-11 05:59:54 +00:00
Brooks Davis
78674822c7 eui64_aton and eui64_ntoa are actually the equivalent of ether_aton_r and
ether_nota_r and do not use static variables so remove the note copied
from ethers.3 saying they do.

Reported by:	bms
MFC after:	3 days
2012-02-08 11:30:13 +00:00
Hajimu UMEMOTO
324930d7f8 Handle the internal scope address representation of the KAME IPv6
stack for the node-local multicast address.

Spotted by:	Rainer Bredehorn <Bredehorn__at__gmx.de>
MFC after:	1 week
2012-01-07 09:01:19 +00:00
Ed Schouten
b3608ae18f Replace index() and rindex() calls with strchr() and strrchr().
The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.
2012-01-03 18:51:58 +00:00
Colin Percival
3e65b9c6e6 Fix a problem whereby a corrupt DNS record can cause named to crash. [11:06]
Add an API for alerting internal libc routines to the presence of
"unsafe" paths post-chroot, and use it in ftpd. [11:07]

Fix a buffer overflow in telnetd. [11:08]

Make pam_ssh ignore unpassphrased keys unless the "nullok" option is
specified. [11:09]

Add sanity checking of service names in pam_start. [11:10]

Approved by:    so (cperciva)
Approved by:    re (bz)
Security:       FreeBSD-SA-11:06.bind
Security:       FreeBSD-SA-11:07.chroot
Security:       FreeBSD-SA-11:08.telnetd
Security:       FreeBSD-SA-11:09.pam_ssh
Security:       FreeBSD-SA-11:10.pam
2011-12-23 15:00:37 +00:00
Michael Tuexen
5dc6a81580 Address warnings found by clang.
MFC after: 3 months.
2011-12-17 14:55:19 +00:00
Gleb Smirnoff
08b68b0e4c A major overhaul of the CARP implementation. The ip_carp.c was started
from scratch, copying needed functionality from the old implemenation
on demand, with a thorough review of all code. The main change is that
interface layer has been removed from the CARP. Now redundant addresses
are configured exactly on the interfaces, they run on.

The CARP configuration itself is, as before, configured and read via
SIOCSVH/SIOCGVH ioctls. A new prefix created with SIOCAIFADDR or
SIOCAIFADDR_IN6 may now be configured to a particular virtual host id,
which makes the prefix redundant.

ifconfig(8) semantics has been changed too: now one doesn't need
to clone carpXX interface, he/she should directly configure a vhid
on a Ethernet interface.

To supply vhid data from the kernel to an application the getifaddrs(8)
function had been changed to pass ifam_data with each address. [1]

The new implementation definitely closes all PRs related to carp(4)
being an interface, and may close several others. It also allows
to run a single redundant IP per interface.

Big thanks to Bjoern Zeeb for his help with inet6 part of patch, for
idea on using ifam_data and for several rounds of reviewing!

PR:		kern/117000, kern/126945, kern/126714, kern/120130, kern/117448
Reviewed by:	bz
Submitted by:	bz [1]
2011-12-16 12:16:56 +00:00
Michael Tuexen
539bb45a7f Fix a bug where sctp_sendmdg() uses uninitialized memory.
MFC after: 3 days.
2011-12-15 12:35:03 +00:00
Michael Tuexen
c9c5805975 Add support for the SCTP_REMOTE_UDP_ENCAPS_PORT socket option.
Retire the the now unused sctp_udp_tunneling_for_client_enable
sysctl variable.

MFC after: 3 months.
2011-11-20 15:00:45 +00:00
Ed Schouten
3a28b8a49f Fix whitespace inconsistencies found in homegrown Symbol.maps. 2011-10-07 15:05:24 +00:00
Hiroki Sato
3462b16f29 Fix a pathname (s,netinet/if_ether.h,net/ethernet.h,).
PR:		docs/159341
Submitted by:	Garrett Cooper
Approved by:	re (kib)
2011-08-08 03:09:03 +00:00
Michael Tuexen
ca85e9482a The result of a joint work between rrs@ and myself at the IETF:
* Decouple the path supervision using a separate HB timer per path.
* Add support for potentially failed state.
* Bring back RTO.min to 1 second.
* Accept packets on IP-addresses already announced via an ASCONF
* While there: do some cleanups.

Approved by: re@
MFC after: 2 months.
2011-08-03 20:21:00 +00:00
Michael Tuexen
bb3c45bf86 Document the latest changes to sctp_opt_info() in the code.
This makes sctp_opt_info() compiliant with the latest version
of the socket API ID.
2011-06-18 10:36:05 +00:00
Michael Tuexen
bb2c20c1a8 Add SCTP_MAX_BURST support to sctp_opt_info().
This only applies to 9.0 and higher, since the type
of the values has changed since we introduced it.
So it can't be MFCed.
2011-06-17 07:06:42 +00:00
Michael Tuexen
13aae0bf1d Update the list of supported socket options for sctp_opt_info().
MFC after: 1 month.
2011-06-17 07:03:42 +00:00
Michael Tuexen
c67a03f99a Fix two typos and remove redundant code.
MFC after: 1 month.
2011-06-16 17:30:50 +00:00
Michael Tuexen
0b064106dd * Fix the handling of addresses in sctp_sendv().
* Add support for SCTP_SENDV_NOINFO.
* Improve the error handling of sctp_sendv() and sctp_recv().

MFC after: 1 month
2011-06-16 15:36:09 +00:00
Michael Tuexen
e2e7c62edc Add support for the newly added SCTP API.
In particular add support for:
* SCTP_SNDINFO, SCTP_PRINFO, SCTP_AUTHINFO, SCTP_DSTADDRV4, and
  SCTP_DSTADDRV6 cmsgs.
* SCTP_NXTINFO and SCTP_RCVINFO cmgs.
* SCTP_EVENT, SCTP_RECVRCVINFO, SCTP_RECVNXTINFO and SCTP_DEFAULT_SNDINFO
  socket option.
* Special association ids (SCTP_FUTURE_ASSOC, ...)
* sctp_recvv() and sctp_sendv() functions.

MFC after: 1 month.
2011-06-15 23:50:27 +00:00
Michael Tuexen
48f65f00fa * Update copyright notice.
* Cleanup usage of iov's.
* Add support for SCTP_TIMEOUTS socketoption.
* Fix a bug in sctp_recvmsg(): return the msg_flags in case of an error.
* Fix a bug in the error handling of sctp_peeloff(): return the -1.
2011-05-05 19:49:27 +00:00
Konstantin Belousov
af5407b895 Fix struct FILE * leak on error (in disabled by default hesiod support code).
Submitted by:	henning petersen <henning.petersen t-online de>
PR:	153756
MFC after:	1 week
2011-01-08 10:56:58 +00:00
Rui Paulo
565424b2fd Clang related fixes:
* When calling syslog(), pass a format string.
* Define YY_NO_INPUT on nslexer.l

Submitted by:	Norberto Lopes <nlopes.ml at gmail.com>
2010-10-13 16:57:06 +00:00
Ulrich Spörlein
0d9deed52c mdoc: drop redundant .Pp and .LP calls
They have no effect when coming in pairs, or before .Bl/.Bd
2010-10-08 12:40:16 +00:00
Hajimu UMEMOTO
c618a8562e When no protocol entry is found, getproto*_r(3) should
return zero.

Spotted by:	Kostik Belousov <kostikbel__at__gmail.com>
MFC after:	2 weeks
2010-10-05 15:40:59 +00:00
Hajimu UMEMOTO
f700faa590 Clear errno for each method dispatch.
Spotted by:	Kostik Belousov <kostikbel__at__gmail.com>
MFC after:	2 weeks
2010-10-04 15:28:01 +00:00
Rebecca Cran
5512804bb8 Revert changes of 'assure' to 'ensure' made in r211936.
Approved by: rrs (mentor)
2010-09-11 10:49:56 +00:00
Rebecca Cran
e7f8dd75b3 Fix incorrect usage of 'assure' and 'insure'.
Approved by: rrs (mentor)
2010-08-28 16:32:01 +00:00
Joel Dahl
c2025a7660 Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
translating these manual pages.  Minor corrections by me.

Submitted by:	Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
2010-08-16 15:18:30 +00:00
Hajimu UMEMOTO
2db99256b1 Correct the return code from _dns_gethostby*() to correspond
with h_errno.

Obtained from:	NetBSD
MFC after:	2 weeks
2010-08-15 16:28:08 +00:00
Hajimu UMEMOTO
225edeac51 - When there is no room for returning the result, nss backend
have to return ERANGE and terminate with NS_RETURN.
- When gethostbyname_r(3) and the friends end with an error,
  set errno to the value nss backend returns, and return errno
  value.

PR:		kern/131623
MFC after:	2 weeks
2010-08-13 06:39:54 +00:00
Joel Dahl
f6ac23919b Fix typos and spelling mistakes. 2010-08-06 14:33:42 +00:00
Joel Dahl
edfa427cf1 Spelling fixes. 2010-08-02 16:01:45 +00:00
Randall Stewart
335a2d00c4 If a user calls sctp_sendx() with a NULL
sinfo we will crash. Instead we should provide
our own temp structure to use internally.

MFC after:	1 month
2010-07-07 11:19:06 +00:00
Rebecca Cran
45d35a30bd Increment 'sa' at the end of the loop; otherwise, only the first
address ever gets checked.

Approved by: rrs (mentor)
MFC after: 1 month
2010-07-05 03:55:49 +00:00
Rebecca Cran
3d36ac9877 Use ISO C99 integer types instead of the BSD-specific u_int*_t.
Approved by: rrs (mentor)
2010-07-04 08:09:33 +00:00
Rebecca Cran
cefac273a4 sctp_recvmsg returns the number of bytes received, not sent.
Approved by:	rrs (mentor)
MFC after:	1 month
2010-06-11 18:43:55 +00:00
Hajimu UMEMOTO
79bbdc60dc Use the stored length value instead of calculating it by strlen(). 2010-04-06 12:33:05 +00:00
Hajimu UMEMOTO
e622b47989 Add capability to use a db version of services. It is enabled by
specifying `db' as source of service in /etc/nsswitch.conf.

MFC after:	2 weeks
2010-04-04 08:31:03 +00:00
Hajimu UMEMOTO
dc6ab8ddb4 Reduce duplicate code.
MFC after:	2 weeks
2010-04-04 07:31:10 +00:00
Hajimu UMEMOTO
aea86367e8 Treat '+' as special only when in compat mode, and simplify
the logic bit.

MFC after:	2 weeks
2010-04-04 07:21:45 +00:00
Hajimu UMEMOTO
8390eaedcc Stop adding trailing '\n'. The servent_unpack() doesn't expect
lines terminated with '\n'.

MFC after:	2 weeks
2010-04-04 07:02:10 +00:00
Rebecca Cran
ecf4b67af3 Remove extra semicolon.
Approved by:	rrs (mentor)
2010-01-31 21:47:39 +00:00
Rebecca Cran
0add3200d1 Fix typo of ENOTCONN.
Add missing RETURN VALUES section in sctp_opt_info(3).

Approved by:	rrs (mentor)
2010-01-31 21:45:14 +00:00
Christian Brueffer
a47698f8d6 Miscellaneous mdoc, spelling and inconsistency fixes.
PR:		142573, 142576 (mostly)
Submitted by:	brucec
MFC after:	1 week
2010-01-12 21:45:03 +00:00
Daniel Gerzo
1743ff6a01 - correct xref sections
PR:		docs/140940
Submitted by:	Bruce Cran <bruce@cran.org.uk>
MFC after:	1 week
2009-11-28 11:27:37 +00:00
Hajimu UMEMOTO
823e5e0ebf Add missing IEEE1394 support dropped during merge from NetBSD. 2009-11-12 11:54:12 +00:00
Hajimu UMEMOTO
a087c7295d ANSIfy.
MFC after:	1 week
2009-11-11 15:21:06 +00:00
Hajimu UMEMOTO
0d384326cd Add NLS catalogs support to gai_strerror(3).
Controlled by NLS define.
2009-11-09 12:46:59 +00:00
Poul-Henning Kamp
aa3e6183ce Revert r196976, now that <machine/param.h> behaves predictably. 2009-09-09 10:31:20 +00:00
Poul-Henning Kamp
0901106030 Add necessary include 2009-09-08 15:18:25 +00:00
Xin LI
5512745e3a Document how to enable strict RFC 1034 enforcements.
PR:		kern/129477
2009-05-29 07:55:44 +00:00
Zachary Loafman
6d72217368 Fix an issue when nss fallback routines are used in a multithreaded application.
Reviewed by:        bushman
Approved by:        dfr (mentor)
2009-05-27 17:01:59 +00:00
Bruce M Simpson
6de9a4eb6b Fix an obvious bug in getsourcefilter()'s use of struct __msfilterreq;
the kernel will return in msfr_nsrcs the number of source filters
in-mode for a given multicast group.
However, the filters themselves were never copied out, as the libc
function clobbers this field with zero, causing the kernel to assume
the provided vector of struct sockaddr_storage has zero length.
This bug would only affect users of SSM multicast, which is shimmed
in 7.x.
Picked up during mtest(8) refactoring.

MFC after:	1 day
2009-04-29 09:58:31 +00:00
Hajimu UMEMOTO
bc42149220 Query DNS only once per an address family.
Obtained from:	KAME
MFC after:	2 weeks
2009-03-29 17:55:11 +00:00
Hajimu UMEMOTO
4d75630780 Add support for SCTP to getaddrinfo(3).
Now, getaddrinfo(3) returns two SOCK_STREAMs, IPPROTO_TCP and
IPPROTO_SCTP.  It confuses some programs.  If getaddrinfo(3) returns
IPPROTO_SCTP when SOCK_STREAM is specified by hints.ai_socktype, at
least Apache doesn't work.  So, I made getaddrinfo(3) to return
IPPROTO_SCTP with SOCK_STREAM only when IPPROTO_SCTP is specified
explicitly by hints.ai_protocol.

PR:		bin/128167
Submitted by:	Bruce Cran <bruce__at__cran.org.uk> (partly)
MFC after:	2 week
2009-03-25 16:23:43 +00:00
Hajimu UMEMOTO
d53978e3c0 getaddrinfo(3) should accept numeric when ai_socktype is not
specified in hint or hints is NULL.

PR:		bin/51827
Submitted by:	Mark Andrews <marka__at__isc.org>
MFC after:	1 week
2009-03-24 17:47:24 +00:00
Bruce M Simpson
1acf7fcc63 Considerably improve the wording of this man page. 2009-03-04 01:59:14 +00:00
Bruce M Simpson
0c0fdcfe15 Update copyright. 2009-03-04 01:58:48 +00:00
Xin LI
a8da143ab8 Add a missing .El. 2009-03-01 05:47:14 +00:00
Hajimu UMEMOTO
aba831de03 Shutup warning for DNAME RR.
PR:		bin/127591
Submitted by:	"Eugene M. Kim" <20080111.freebsd.org__at__ab.ote.we.lv>
MFC after:	1 week
2009-02-08 16:58:05 +00:00
Daniel Gerzo
19cc5aa64b - forgot to bump a date 2009-01-06 13:10:15 +00:00
Daniel Gerzo
7cfc1e329f catch up wtih r175955 by ume:
- the support of AI_ALL and AI_V4MAPPED has been completely removed.
2009-01-06 13:05:58 +00:00
Murray Stokely
4e543e5c37 Add an ENVIRONMENT section to note that the RSH variable can be set to
override the use of the rsh(1) program in rcmd(3).

PR:		docs/51133
Obtained from:	NetBSD, partially
MFC after:	3 weeks
2008-12-14 22:48:48 +00:00
Daniel Gerzo
05e3085a53 - AI_ALL and AI_V4MAPPED flags are currently not supported
PR:		docs/120248
Submitted by:	Heiko Wundram <wundram (a) beenic.net>
2008-07-01 22:59:20 +00:00
John Baldwin
ab9306707a Include libc_private.h for the declaration of __isthreaded instead of
relying on namespace pollution in stdio.h.

MFC after:	3 days
2008-05-02 14:51:22 +00:00
Hajimu UMEMOTO
6b299433de Remove incomplete support of AI_ALL and AI_V4MAPPED.
Reported by:	"Heiko Wundram (Beenic)" <wundram__at__beenic.net>
2008-02-03 19:07:55 +00:00
Michael Bushkov
36736e35e8 Moved logging out of the nss_method_lookup() in order not to
flood logs with failed fallback method lookup attempts.
2007-12-17 16:12:57 +00:00
Michael Bushkov
a59d6a8724 Implementing 'fallback' nsswitch source. 'fallback' source is used
when particular function can't be found in nsswitch-module. For
example, getgrouplist(3) will use module-supplied 'getgroupmembership'
function (which can work in an optimal way for such source as LDAP) and
will fall back to the stanard iterate-through-all-groups implementation
otherwise.

PR:		ports/114655
Submitted by:	Michael Hanselmann <freebsd AT hansmi DOT ch>
Reviewed by:	brooks (mentor)
2007-12-12 10:08:03 +00:00
Ruslan Ermilov
faad9cae56 Fix bad rule and bad dependency for nsparser.h that can
cause the build to fail because y.tab.c can have a more
recent modification time than y.tab.h, and the bad rule
relied on the opposite.

(The last write to y.tab.c by yacc(1) happens after the
last write to y.tab.h, according to truss(1).)

Reported by:	kensmith
2007-11-15 22:39:15 +00:00
Giorgos Keramidas
ef824a431f mdoc fix: remove extraneous empty line.
MFC after:	3 days
2007-10-30 15:31:41 +00:00
Tom McLaughlin
908556717f - Correctly define CACHED_SOCKET_PATH as /var/run/nscd after cached to
nscd renaming.

Approved by:	mux
2007-10-17 23:20:49 +00:00
Christian Brueffer
44d9c28191 Assorted spelling, punctuation and mdoc fixes.
Approved by:	re (blanket)
2007-09-25 16:48:08 +00:00
Gabor Kovesdan
694b0a6ba4 - Fix description to say "receive" instead of "send"
PR:		docs/115466
Submitted by:	Bruce Cran <bruce@cran.org.uk>
Approved by:	re (bmah)
2007-09-20 10:49:10 +00:00
JINMEI Tatuya
e47c82ed72 ensure the head entry of addrinfo chain has non-NULL ai_canonname to be
compliant with RFC3493.

PR: standards/114910
Approved by:   ume (mentor)
Approved by:   re
MFC after:     1 week
2007-09-05 18:08:14 +00:00
Michael Bushkov
3e83e4a3f2 - Getipnodebyname() and getipnodebyaddr() reimplemented through
gethostbyname() and gethostbyaddr() accordingly

Approved by:	re (kensmith), brooks (mentor)
2007-07-31 16:09:41 +00:00
Randall Stewart
1b649582bb - take out a needless panic under invariants for sctp_output.c
- Fix addrs's error checking of sctp_sendx(3) when addrcnt is less than
   SCTP_SMALL_IOVEC_SIZE
 - re-add back inpcb_bind local address check bypass capability
 - Fix it so sctp_opt_info is independant of assoc_id postion.
 - Fix cookie life set to use MSEC_TO_TICKS() macro.
 - asconf changes
   o More comment changes/clarifications related to the old local address
    "not" list which is now an explicit restricted list.

   o Rename some functions for clarity:
     - sctp_add/del_local_addr_assoc to xxx_local_addr_restricted()
     - asconf related iterator functions to sctp_asconf_iterator_xxx()

   o Fix bug when the same address is deleted and added (and removed from
     the asconf queue) where the ifa is "freed" twice refcount wise,
     possibly freeing it completely.

   o Fix bug in output where the first ASCONF would not go out after the
     last address is changed (e.g. only goes out when retransmitted).

   o Fix bug where multiple ASCONFs can be bundled in the same packet with
     the and with the same serial numbers.

   o Fix asconf stcb iterator to not send ASCONF until after all work
     queue entries have been processed.

   o Change behavior so that when the last address is deleted (auto asconf
     on a bound all endpoint) no action is taken until an address is
     added; at that time, an ASCONF add+delete is sent (if the assoc
     is still up).

   o Fix local address counting so that address scoping is taken into
     account.

   o #ifdef SCTP_TIMER_BASED_ASCONF the old timer triggered sending
     of ASCONF (after an RTO).  The default now is to send
     ASCONF immediately (except for the case of changing/deleting the
     last usable address).
Approved by:	re(ken smith)@freebsd.org
2007-07-24 20:06:02 +00:00
Randall Stewart
b54d3a6c48 - Modular congestion control, with RFC2581 being the default.
- CMT_PF states added (w/sysctl to turn the PF version on)
- sctp_input.c had a missing incr of cookie case when the
  auth was bad. This meant a free was called without an
  increment to refcnt, added increment like rest of code.
- There was a case, unlikely, when the scope of the destination
  changed (this is a TSNH case). In that case, it would not free
  the alloc'ed asoc (in sctp_input.c).
- When listed addresses found a colliding cookie/Init, then
  the collided upon tcb was not unlocked in sctp_pcb.c
- Add error checking on arguments of sctp_sendx(3) to prevent it from
  referencing a NULL pointer.
- Fix an error return of sctp_sendx(3), it was returing
  ENOMEM not -1.
- Get assoc id was changed to use the sanctified socket api
  method for getting a assoc id (PEER_ADDR_INFO instead of
  PEER_ADDR_PARAMS).
- Fix it so a peeled off socket will get a proper error return
  if it trys to send to a different address then it is connected to.
- Fix so that select_a_stream can avoid an endless loop that
  could hang a caller.
- time_entered (state set time) was not being set in all cases
  to the time we went established.
Approved by:	re(ken smith)
2007-07-14 09:36:28 +00:00
Peter Wemm
f275d39c8f Fix missing prototype warnings. (Compile errors with -Werror on)
When using namespace.h/un-namespace.h, you use _ versions of syscalls.
Change getsockopt() to _getsockopt() and same for setsockopt().

Approved by:  re
2007-07-04 00:55:50 +00:00
Randall Stewart
602afc03e4 - Removes some incorrect error returns (errno was being overriden in
one of the functions)
- Fixes the error return of sctp_get_opt, it was returning the errno not
 -1.
Approved by:	re@freebsd.org (Robert Watson)
Obtained from:	Weongyo Jeong (weongyo.jeong@gmail.com)
2007-07-02 10:52:34 +00:00
Matt Jacob
f1d305391f Add missing semi-colon.
Approved by:	re (not really, but it's better to have things compile than not for right now. Sorry)
2007-06-26 02:07:47 +00:00
Randall Stewart
25d63f19e6 - Fix wrong error return (the errno was being returned and not placed
in errno) - Found by Weongyo Jeong
- Remove two extra un-needed memset() after calloc()'s - Found by
  Weongyo Jeong
- Tightened up parameter requirement checking on input to
  bindx/connectx per socket api spec.
Approved by:	re@freebsd.org(Ken Smith)
2007-06-25 18:58:27 +00:00
Randall Stewart
a593094ea0 - Fix incorrect error return on sctp_getaddrlen
- Fix a memory leak when a non v4/v6 address was passed in.
- Take out strange line that copy's back to the src array
  incorrectly (corrupting the input array).

Approved by:	re(bmah@freebsd.org)
Obtained from:	Weongyo Jeong(weongyo.jeong@gmail.com)
2007-06-22 13:59:54 +00:00
Christian Brueffer
c89181915c Clean up after previous commit: new sentence -> new line, no empty lines,
.Fa macro usage.

Approved by:	re (blanket)
2007-06-19 16:29:46 +00:00
Randall Stewart
7e94ae79f3 - Fix the signature of sctp_connectx to match the function and adds some
text about the last argument.
Approved by:	re (bmah@freebsd.org)
2007-06-19 16:18:43 +00:00
Christian Brueffer
16c90ceeb3 Major cleanup: mdoc macros, style, typos etc. 2007-06-18 10:20:32 +00:00
Xin LI
0bb263df82 Require users to provide a length information for inet_ntoa_r,
this is common on other platforms.

Reported by:	pointyhat via kris
2007-06-14 07:13:28 +00:00
Andrey A. Chernov
418130b101 Fix yet another (make install) stopper with wrong sourcefilter.3 links 2007-06-12 22:32:52 +00:00
Bruce M Simpson
9153727f2f Fix typo in filename from mismerged earlier rev of this file. 2007-06-12 21:05:31 +00:00
Bruce M Simpson
a85a378773 Fix a typo which crept in from an earlier version of this file. 2007-06-12 19:08:38 +00:00
Bruce M Simpson
35c261275e Add missing userland support files from previous commit for the new
multicast source filter API functions.
2007-06-12 18:03:37 +00:00
Bruce M Simpson
71498f308b Import rewrite of IPv4 socket multicast layer to support source-specific
and protocol-independent host mode multicast. The code is written to
accomodate IPv6, IGMPv3 and MLDv2 with only a little additional work.

This change only pertains to FreeBSD's use as a multicast end-station and
does not concern multicast routing; for an IGMPv3/MLDv2 router
implementation, consider the XORP project.

The work is based on Wilbert de Graaf's IGMPv3 code drop for FreeBSD 4.6,
which is available at: http://www.kloosterhof.com/wilbert/igmpv3.html

Summary
 * IPv4 multicast socket processing is now moved out of ip_output.c
   into a new module, in_mcast.c.
 * The in_mcast.c module implements the IPv4 legacy any-source API in
   terms of the protocol-independent source-specific API.
 * Source filters are lazy allocated as the common case does not use them.
   They are part of per inpcb state and are covered by the inpcb lock.
 * struct ip_mreqn is now supported to allow applications to specify
   multicast joins by interface index in the legacy IPv4 any-source API.
 * In UDP, an incoming multicast datagram only requires that the source
   port matches the 4-tuple if the socket was already bound by source port.
   An unbound socket SHOULD be able to receive multicasts sent from an
   ephemeral source port.
 * The UDP socket multicast filter mode defaults to exclusive, that is,
   sources present in the per-socket list will be blocked from delivery.
 * The RFC 3678 userland functions have been added to libc: setsourcefilter,
   getsourcefilter, setipv4sourcefilter, getipv4sourcefilter.
 * Definitions for IGMPv3 are merged but not yet used.
 * struct sockaddr_storage is now referenced from <netinet/in.h>. It
   is therefore defined there if not already declared in the same way
   as for the C99 types.
 * The RFC 1724 hack (specify 0.0.0.0/8 addresses to IP_MULTICAST_IF
   which are then interpreted as interface indexes) is now deprecated.
 * A patch for the Rhyolite.com routed in the FreeBSD base system
   is available in the -net archives. This only affects individuals
   running RIPv1 or RIPv2 via point-to-point and/or unnumbered interfaces.
 * Make IPv6 detach path similar to IPv4's in code flow; functionally same.
 * Bump __FreeBSD_version to 700048; see UPDATING.

This work was financially supported by another FreeBSD committer.

Obtained from:  p4://bms_netdev
Submitted by:   Wilbert de Graaf (original work)
Reviewed by:    rwatson (locking), silence from fenner,
		net@ (but with encouragement)
2007-06-12 16:24:56 +00:00
Randall Stewart
2c356be294 - Validate incoming addresses and sizes for connectx and bindx.
- For non-sys call version pass the msg_flags.
2007-06-11 21:05:29 +00:00
Xin LI
0c927cdd8e Add inet_ntoa_r, a reentrant version of inet_ntoa. This is
available on a lot of platforms, as well as libkern for years.

Submitted by:	"MQ"
2007-06-11 07:21:21 +00:00
Remko Lodder
eb1db428b7 Document getaddrinfo(3)'s AI_ADDRCONFIG
PR:		docs/78357
Submitted by:	Matthias Andree <matthias dot andree at gmx dot de>
Patch by:	asmodai
MFC after:	1 week
2007-06-06 19:24:02 +00:00
Daniel Eischen
2665faf497 Some libc symbol map cleanups.
net: endhostdnsent is named _endhostdnsent and is
  private to netdb family of functions.

  posix1e: acl_size.c has been never compiled in,
  so there's no "acl_size".

  rpc: "getnetid" is a static function.

  stdtime: "gtime" is #ifdef'ed out in the source.

  some symbols are specific only to some architectures,
  e.g., ___tls_get_addr is only defined on i386.

  __htonl, __htons, __ntohl and __ntohs are no longer
  functions, they are now (internal) defines in
  <machine/endian.h>.

Submitted by:	ru
2007-05-31 13:01:34 +00:00
Robert Watson
7a2f86ce08 Precede symbol names consistently with tabs rather than spaces. 2007-05-28 11:33:44 +00:00
Ruslan Ermilov
7172f8c4db Also fix the misspelling of hes_resolve().
Submitted by:	Danny Braniss
2007-05-25 09:58:25 +00:00
Ruslan Ermilov
6f9900d9f6 hesiod_resolv -> hesiod_resolve
Submitted by:	Danny Braniss
2007-05-24 13:50:06 +00:00
Jonathan Chen
bb5bff06a7 Move nss_compat symbols from r1.11 to private section of symbol map.
Suggested by: deischen
2007-05-18 15:41:54 +00:00
Jonathan Chen
6a536ad948 __nss_compat_* from net/nss_compat.c are needed by ports/net/nss_ldap, so export them. 2007-05-18 05:45:28 +00:00
Jonathan Chen
7a800a56f7 fix memory leak from reading nsswitch.conf
MFC after:	1 week
2007-05-17 03:33:23 +00:00
Randall Stewart
002b1f0bba -Fix so getoptinfo() is in conformance with socket api (it
can be used on any read socketopt).
-Clean up of sendmsg call and make it conformant when no syscall
 is available.
2007-05-16 20:23:39 +00:00
Randall Stewart
ad9f3b406a Resolves symbols map so sctp_xxx() functions are included.
PR:		112704
Submitted by:	kou@cozmixng.org
2007-05-16 20:20:54 +00:00
Robert Watson
caa399aa66 Add ether_aton_r and ether_ntoa_r to public symbol map for libc.
Pointed out by:	deischen
2007-05-13 15:01:25 +00:00
Robert Watson
62ad77f006 Add and document ether_ntoa_r() and ether_aton_r() functions, which accept
passed storage buffers rather than using static storage.  Reimplement
ether_ntoa() and ether_aton() in terms of these functions.  These variants
are thread-safe.
2007-05-13 13:57:45 +00:00
Robert Watson
b06619453f Move to more conformant style(9) before making functional changes. 2007-05-13 12:04:06 +00:00
Daniel Eischen
5f864214bb Use C comments since we now preprocess these files with CPP. 2007-04-29 14:05:22 +00:00
Mike Makonnen
18a6073100 Make inet6_rth_* family of functions more compliant with RFC3542:
1. CMSG_NXTHDR(mhdr, cmsg) is supposed to dereference cmsg and return
   the next header in the chain. If cmsg is NULL it should return
   the first header, behaving essentially like CMSG_FIRSTHDR().
2. inet6_rth_(space|init|add) should do basic checking on their input
   to verify that the number of headers (segments) is
   between 0 and 127 inclusive.

MFC-After: 1 month
2007-04-19 15:48:16 +00:00
Max Laier
02023242ea Let people in on the magic of INET[6]_ADDRSTRLEN which comes quite handy in
combination with inet_ntop().

Reviewed by:	trhodes "works for me"
2007-03-21 05:46:18 +00:00
Randall Stewart
42551e993f - Sysctl's move to seperate file
- moved away from ifn/ifa access to sctp_ifa/sctp_ifn
  built and managed by the add-ip code.
- cleaned up add-ip code to use the iterator
- made iterator be a thread, which enables auto-asconf now.
- rewrote and cleaned up source address selection (also
  made it use new structures).
- Fixed a couple of memory leaks.
- DACK now settable as to how many packets to delay as
  well as time.
- connectx() to latest socket API, new associd arg.
- Fixed issue with revoking and loosing potential to
  send when we inflate the flight size. We now inflate
  the cwnd too and deflate it later when the revoked
  chunk is sent or acked.
- Got rid of some temp debug code
- src addr selection moved to a common file (sctp_output.c)
- Support for simple VRF's (we have support for multi-vfr
  via compile switch that is scrubbed from BSD but we won't
  need multi-vrf until we first get VRF :-D)
- Rest of mib work for address information now done
- Limit number of addresses in INIT/INIT-ACK to
  a #def (30).

Reviewed by:	gnn
2007-03-15 11:27:14 +00:00
Bruce M Simpson
160a2e5504 Document the AF_LINK extension which was imported from NetBSD. 2007-02-28 21:28:33 +00:00
Bruce M Simpson
67228c4621 Nuke ascii2addr() and addr2ascii(). They have no consumers anywhere
in FreeBSD, and originated from INRIA IPv6.

Stub out netstat reference to addr2ascii() I mistakenly introduced.
Update misleading man page sections.

Merge NetBSD's getnameinfo() AF_LINK extensions for a portable way to
print link-layer addresses given a sockaddr_dl(), minus the IEEE 1394
bits which don't map directly to our code.

Obtained from:	NetBSD (getnameinfo.c)
Discussed on:	current (March 2006)
2007-02-28 21:18:38 +00:00
Randall Stewart
7c3768006d Fix include declaration it was sys/sctp.h should be netinet/sctp.h,
reported by pluknet@gmail.com.
2007-02-26 12:23:32 +00:00
Randall Stewart
2cbcccc774 Fixes build breakage.. invalid type casts.. and invalid
type for size in one place.
2007-02-22 14:48:12 +00:00
Randall Stewart
d8b5fd91b9 First cut of the sctp man pages. Still need work. 2007-02-22 14:32:39 +00:00
Randall Stewart
2c0d559d1e Fixes __FreeBSD__ being present (they should not)
and also trailing garbage on undef of magic numbers.
2007-02-22 13:39:57 +00:00
Randall Stewart
804cf64147 Adds a performance improvement for when sctp_sendx is
called with only one address, we then can call the
generic system call. Also fixes some socket api
type issues and cleans up the "magic" numbers that
were being used in the code.

Reviewed by:	gnn
2007-02-22 12:42:43 +00:00
Bruce M Simpson
50c317ac7c Docuemnt exactly which functions access which NSS databases.
Point out that FreeBSD libc has compat stubs for GNU glibc NSS
modules which access NSDB_PASSWD/NSDB_GROUP, but not NSDB_HOSTS;
based on painful experience porting nss_mdns.

Reviewed by:	ru
2007-01-22 11:45:25 +00:00
Warner Losh
c879ae3536 Per Regents of the University of Calfornia letter, remove advertising
clause.

# If I've done so improperly on a file, please let me know.
2007-01-09 00:28:16 +00:00
Craig Rodrigues
066f54d831 Consistently use a socklen_t type where required, and eliminate
GCC warning "dereferencing type-punned pointer will
break strict-aliasing rules".

Reviewed by:	rrs
2006-12-16 06:03:43 +00:00
Randall Stewart
d6dda9b282 This adds the "system calls"
sctp_getaddrlen()
 sctp_connectx()
 sctp_bindx()
 sctp_opt_info()
 sctp_getpaddrs()
 sctp_freepaddrs()
 sctp_getladdrs()
 sctp_freeladdrs()
 sctp_sendmsg()
 sctp_getassocid()
 sctp_send()
 sctp_sendx()
 sctp_sendmsgx()
 sctp_recvmsg()
 sctp_peeloff()

Manual pages will be forthcoming (and the commit to porters-handbook)
2006-12-15 12:01:50 +00:00
Hajimu UMEMOTO
909e7467d8 Use _kevent() instead of kevent().
Requested by:	nork
2006-12-04 17:08:43 +00:00
Olivier Houchard
05b432d2d1 Instead of re-implementing hton[ls] and friends for each arch, add a new MI
file, net/ntoh.c, which just implement them using the inline functions from
<sys/endian.h>.

Suggested by:	bde
2006-11-06 22:07:47 +00:00
Sam Lawrance
6b0a380f6d Document return values for res_query and res_search.
h_errno is not an extern int, just a macro providing an integer lvalue.

PR:		doc/50573
Submitted by:	Ronald F.Guilmette <rfg@monkeys.com>
Reviewed by:	trhodes
MFC after:	3 days
2006-11-04 09:42:22 +00:00
Ruslan Ermilov
0f0eddbb01 Add missing markup bits.
Submitted by:	Emil Mikulic
2006-10-28 13:05:10 +00:00
Ruslan Ermilov
a73a3ab56b Markup fixes. 2006-09-17 21:27:35 +00:00
Yaroslav Tykhiy
11eb328ec5 Respect MK_INET6_SUPPORT. 2006-07-26 08:36:46 +00:00
Yaroslav Tykhiy
720fc1c7dc Fix build w/o INET6.
Submitted by:	Andre Albsmeier <Andre.Albsmeier siemens com>
2006-07-26 08:35:46 +00:00
Hajimu UMEMOTO
e24e9d9988 do not overload the port number on to the return value of
str2number().  this could result in an unexpected code path.

Obtained from:	KAME
MFC after:	1 week
2006-07-23 15:31:03 +00:00
Hajimu UMEMOTO
18d2f53d00 stop use of mutex lock in ICMP lookup.
MFC after:	1 week
2006-07-23 07:07:49 +00:00
Hajimu UMEMOTO
816dc28540 remove obsolete comments.
MFC after:	3 days
2006-07-22 14:36:56 +00:00
Hajimu UMEMOTO
da83bf18e4 simplification in explore_numeric: unified the post-process with
GET_AI and GET_PORT.  Commented on an impossible case.

Obtained from:	KAME
MFC after:	1 week
2006-07-21 19:02:28 +00:00
Hajimu UMEMOTO
0cf41987df RFC3493 requires use of inet_aton for AF_INET.
Obtained from:	KAME
MFC after:	1 week
2006-07-21 19:00:22 +00:00
Hajimu UMEMOTO
0aceddcef7 clean-up: rewrote explore_null and explore_numeric without using sentinel.
we do not need it since we make (at most) a single addrinfo entry in these
cases.

Obtained from:	KAME
MFC after:	1 week
2006-07-21 18:57:44 +00:00
Hajimu UMEMOTO
b88ad6b5d6 - draft-ietf-ipngwg-icmp-namelookups-09
- make it compilable

It still requires root privilege and is experimental.

Obtained from:	KAME
MFC after:	1 week
2006-07-21 18:55:51 +00:00
Stefan Farfeleder
33ef612ede Use a prototype for res_init().
MFC after:	3 days
2006-07-17 09:27:26 +00:00
Hajimu UMEMOTO
1bdf356bd3 Fix gethostbyaddr() prototype to conform to IEEE Std 1003.1 on 64 bit
arch.

X-MFC after:	never
2006-05-21 11:27:28 +00:00
Hajimu UMEMOTO
734aa10414 Return EAI_OVERFLOW instead of EAI_MEMORY when the supplied buffer is
too short.  This conforms to RFC3493, POSIX and XPG6.

Obtained from:	NetBSD
2006-05-21 11:22:31 +00:00
Hajimu UMEMOTO
d808369aa1 Upgrade res_update(3) and the friends to BIND9's one excluding TSIG
support.

X-MFC after:	never
2006-05-21 11:19:36 +00:00
Hajimu UMEMOTO
3da59cd007 Fix gethostbyaddr() prototype to conform to IEEE Std 1003.1:
http://www.opengroup.org/onlinepubs/009695399/functions/gethostbyaddr.html

gethostbyaddr_r() is changed as well.
It breaks ABI backward compatibility on 64 bit arch.  So, we fix it
on 32 bit arch only for now.

Reported by:	Rostislav Krasny <rosti.bsd@gmail.com>
2006-05-12 15:37:23 +00:00
Hajimu UMEMOTO
b947683ce1 Fix alignment problem on AMD64.
Reported by:	Pascal Hofstee <caelian__at__gmail.com>
Submitted by:	Michael Bushkov <bushman__at__rsu.ru>
Tested by:	Pascal Hofstee <caelian__at__gmail.com>
2006-05-02 23:02:32 +00:00
Hajimu UMEMOTO
eb59e992e1 cache' couldn't co-exist with compat'.
Submitted by:	"Michael Bushkov" <bushman__at__rsu.ru>
2006-04-30 21:25:00 +00:00
Hajimu UMEMOTO
06a99fe36f - Extend the nsswitch to support Services, Protocols and Rpc
databases.
- Make nsswitch support caching.

Submitted by:	Michael Bushkov <bushman__at__rsu.ru>
Sponsored by:	Google Summer of Code 2005
2006-04-28 12:03:38 +00:00
Hajimu UMEMOTO
d3ac2b30d4 - make reentrant version of netdb functions glibc style API, and
expose them to outside of libc.
- make netdb functions NSS friendly.

Reviewed by:	arch@ and current@ (no objection)
2006-04-15 16:20:27 +00:00
Hajimu UMEMOTO
3c3c80e4c8 fix indent. 2006-04-01 15:53:39 +00:00