Commit Graph

729 Commits

Author SHA1 Message Date
Michael Tuexen
7f15a8dff2 Remove the number of addresses restriction from sctp_connectx().
Remove unused code.
While there, do some cleanup of the code.

MFC after: 1 week
2013-04-10 11:26:30 +00:00
Jilles Tjoelker
37aafc3318 libc: Avoid SIGPIPE when nscd closes the connection unexpectedly.
It is almost always a bug if nscd closes the connection unexpectedly but
programs should not be killed with SIGPIPE for it.

Reviewed by:	bushman
Tested by:	Jan Beich
MFC after:	1 week
2013-03-13 18:38:18 +00:00
Niclas Zeising
d3087c8fe0 Change examples to be consistent with what style(9) says.
Approved by:	joel (mentor)
MFC After:	2 weeks
2013-02-14 21:29:55 +00:00
Michael Tuexen
4224e03ae7 Improve code style. No functional change.
MFC after: 3 days
2013-02-10 19:21:17 +00:00
Hajimu UMEMOTO
f09c52c333 Re-enable ip6addrctl support but only for IPv6 address.
Requested by:	Ben Morrow <ben__at__morrow.me.uk>
MFC after:	1 week
2013-01-10 14:08:19 +00:00
Hajimu UMEMOTO
d38f4ead6f Disable destination address selection support of
getipnodebyname(1).  RFC 2553 mentions IPv6 addresses
are returned 1st.

Spotted by:	uqs
MFC after:	1 week
2013-01-09 15:22:37 +00:00
Michael Tuexen
9340982291 Cleanup the code a bit, which improves the portability.
MFC after: 1 week
2012-11-19 19:26:19 +00:00
Michael Tuexen
d51b57018e Fix the handling of mapped IPv6 addresses in sctp_connectx().
MFC after: 3 days
2012-11-19 19:19:04 +00:00
Kevin Lo
5744601120 - the preferred way to write a NULL pointer constant is with NULL
- whitespace nit

Reviewed by:	glebius
2012-11-16 15:02:35 +00:00
Michael Tuexen
4ed0ebf649 Fix errno in a couple of error cases.
MFC after: 3 days
2012-11-03 13:22:25 +00:00
Eitan Adler
db702c59cf remove duplicate semicolons where possible.
Approved by:	cperciva
MFC after:	1 week
2012-10-22 03:00:37 +00:00
Maksim Yevmenkin
0c19b5de29 Return zero from get_addrselectpolicy() when no source-address-selection
policy is installed.

MFC after:	1 week
2012-07-18 15:52:09 +00:00
Jilles Tjoelker
2bd56eacf8 libc: Remove some unused strings from getaddrinfo(). 2012-07-15 20:39:21 +00:00
David E. O'Brien
d91d816266 Be explicit about the dependency on nsparser.h. 2012-06-21 15:47:06 +00:00
Dimitry Andric
f61ac9d9bd Fix two warnings about self-assignment in libc. These normally only
trigger with clang, when you either use -save-temps, or ccache.

Reported by:	Sevan / Venture37 <venture37@gmail.com>
MFC after:	3 days
2012-06-06 21:16:26 +00:00
Michael Tuexen
43dc9e2f41 Update copyright date.
MFC after: 3 days
2012-05-23 10:35:40 +00:00
Kevin Lo
d52995b6cf Add missing header needed by free()
Reported by:	tinderbox
2012-05-22 01:28:32 +00:00
Marcel Moolenaar
cf0d539f8b Use the LLINDEX macro to access the link-level I/F index. This makes
it possible to work with a different type for the sdl_index field --
it only requires a recompile.

Obtained from:	Juniper Networks, Inc.
2012-05-19 02:39:43 +00:00
Joel Dahl
67783ce453 mdoc: avoid unterminated quoted strings. 2012-05-13 14:28:00 +00:00
Glen Barber
a3fb6da9ba General mdoc(7) and typo fixes.
PR:		167734
Submitted by:	Nobuyuki Koganemaru (kogane!jp.freebsd.org)
MFC after:	3 days
2012-05-11 20:06:46 +00:00
Michael Tuexen
ff9452e199 Remove debug output.
MFC after: 3 days
2012-05-04 10:26:50 +00:00
Michael Tuexen
a1cd9c816d Move sctp_sendv and sctp_recvv to FBSD_1.3 as suggested by
Konstantin Belousov.

MFC after: 1 week.
X-MFC with: r234715
2012-04-26 19:56:06 +00:00
Michael Tuexen
0273a6a333 Export symbols for sctp_sendv() and sctp_recvv().
MFC after: 1 week
2012-04-26 19:31:16 +00:00
Eitan Adler
e44d947d5a When searching for uninitialized memory usage add ensure that the entire
struct is set to zero.

PR:		bin/166483
Submitted by:	Roy Marples <roy@marples.name>
Reviewed by:	delphij
Approved by:	cperciva
MFC after:	3 days
2012-04-15 23:56:03 +00:00
Xin LI
32ffd2336c Eliminate two cases of unwanted strncpy(). The name is not required
by the current code, and the results would get overwritten anyway
by subsequent memset().

Reviewed by:	ume
MFC after:	1 month
2012-04-02 07:42:17 +00:00
Eitan Adler
50d675f7a9 Remove trailing whitespace per mdoc lint warning
Disussed with:	gavin
No objection from:	doc
Approved by:	joel
MFC after:	3 days
2012-03-29 05:02:12 +00:00
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