Commit Graph

635 Commits

Author SHA1 Message Date
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