summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
Commit message (Collapse)AuthorAgeFilesLines
* correct bounds checksam2005-03-161-1/+1
| | | | Noticed by: Coverity Prevent analysis tool
* refer opencrypto/cast.h directly.ume2005-03-111-1/+9
|
* reported from VANHULLEBUS Yvan [remote kernel crash may result]ume2005-03-091-1/+1
| | | | | | Submitted by: itojun Obtained from: KAME MFC after: 1 day
* ignores ICMPv6 code field in case of ICMPv6 Packet-Too-Big (as specified in ↵suz2005-03-021-2/+0
| | | | | | | RFC2463 and draft-ietf-ipngwg-icmp-v3-06.txt) Obtained from: KAME MFC after: 1 day
* icmp6_notify_error uses IP6_EXTHDR_CHECK, which in turn callsume2005-02-271-4/+6
| | | | | | | | | | | m_pullup. icmp6_notify_error continued to use the old pointer, which after the m_pullup is not suitable as a packet header any longer (see m_move_pkthdr). and this is what causes the kernel panic in sbappendaddr later on. PR: kern/77934 Submitted by: Gerd Rausch <gerd@juniper.net> MFC after: 2 days
* fix typo.ume2005-02-271-2/+2
| | | | MFC after: 2 days
* initialized the last arg to ip6_process_hopopts(), because the recentume2005-02-271-3/+3
| | | | | | | | | code requires it to be 0 when a jumbo payload option is contained. PR: kern/77934 Submitted by: Gerd Rausch <gerd@juniper.net> Obtained from: KAME MFC after: 2 days
* remove dead codesam2005-02-251-3/+3
| | | | Noticed by: Coverity Prevent analysis tool
* eliminate dead codesam2005-02-231-6/+6
| | | | Noticed by: Coverity Prevent analysis tool
* Add CARP (Common Address Redundancy Protocol), which allows multipleglebius2005-02-226-5/+82
| | | | | | | | | | | | | hosts to share an IP address, providing high availability and load balancing. Original work on CARP done by Michael Shalayeff, with many additions by Marco Pfatschbacher and Ryan McBride. FreeBSD port done solely by Max Laier. Patch by: mlaier Obtained from: OpenBSD (mickey, mcbride)
* Add missed merge of ripcbinfo extern. Given how widely usedrwatson2005-02-091-0/+1
| | | | | | ripcbinfo is, we should probably add it to an include file. Spotted by: mux
* Lock raw IP socket pcb list and PCBs when processing input viarwatson2005-02-081-5/+13
| | | | | | | icmp6_rip6_input(). Reviewed by: gnn MFC after: 1 week
* Remove a comment from the raw IPv6 output function regardingrwatson2005-02-061-6/+0
| | | | | | M_TRYWAIT allocations: M_PREPEND() now uses M_DONTWAIT. MFC after: 3 days
* we don't need to make fake sockaddr_in6 to compare subject address.ume2005-01-211-13/+2
| | | | MFC after: 1 week
* /* -> /*- for license, minor formatting changes, separate for KAMEimp2005-01-0768-91/+91
|
* In certain cases ip_output() can free our route, so checkglebius2004-12-101-1/+2
| | | | | | for its presence before RTFREE(). Noticed by: ru
* style the last changeglebius2004-12-091-2/+2
|
* MFinet4:glebius2004-12-091-3/+10
| | | | | | | - Make route cacheing optional, configurable via IFF_LINK0 flag. - Turn it off by default. Reminded by: suz
* Reviewed by: SUZUKI Shinsuke <suz@kame.net>gnn2004-11-291-17/+34
| | | | | | | | | | Approved by: Robert Watson <rwatson@freebsd.org> Add locking to the IPv6 scoping code. All spl() like calls have also been removed. Cleaning up the handling of ifnet data will happen at a later date.
* support TCP-MD5(IPv4) in KAME-IPSEC, too.suz2004-11-081-0/+6
| | | | MFC after: 3 week
* Initialize struct pr_userreqs in new/sparse style and fill in commonphk2004-11-082-10/+23
| | | | | | default elements in net_init_domain(). This makes it possible to grep these structures and see any bogosities.
* fixed a bug that incorrect IPsec request level may be returned for proto AHsuz2004-10-281-0/+1
| | | | Obtained from: KAME
* Be more careful to only index valid IP protocols and be more verbose withandre2004-10-191-2/+11
| | | | comments.
* Push acquisition of the accept mutex out of sofree() into the callerrwatson2004-10-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (sorele()/sotryfree()): - This permits the caller to acquire the accept mutex before the socket mutex, avoiding sofree() having to drop the socket mutex and re-order, which could lead to races permitting more than one thread to enter sofree() after a socket is ready to be free'd. - This also covers clearing of the so_pcb weak socket reference from the protocol to the socket, preventing races in clearing and evaluation of the reference such that sofree() might be called more than once on the same socket. This appears to close a race I was able to easily trigger by repeatedly opening and resetting TCP connections to a host, in which the tcp_close() code called as a result of the RST raced with the close() of the accepted socket in the user process resulting in simultaneous attempts to de-allocate the same socket. The new locking increases the overhead for operations that may potentially free the socket, so we will want to revise the synchronization strategy here as we normalize the reference counting model for sockets. The use of the accept mutex in freeing of sockets that are not listen sockets is primarily motivated by the potential need to remove the socket from the incomplete connection queue on its parent (listen) socket, so cleaning up the reference model here may allow us to substantially weaken the synchronization requirements. RELENG_5_3 candidate. MFC after: 3 days Reviewed by: dwhite Discussed with: gnn, dwhite, green Reported by: Marc UBM Bocklet <ubm at u-boot-man dot de> Reported by: Vlad <marchenko at gmail dot com>
* fixed too delayed routing cache expiry. (tvtohz() converts a time interval ↵suz2004-10-061-4/+4
| | | | | | to ticks, whereas hzto() converts an absolute time to ticks) Obtained from: KAME
* Prevent reentrancy of the IPv6 routing code (leading to crash withgreen2004-10-031-5/+26
| | | | INVARIANTS on, who knows what with it off).
* Disable MTU feedback in IPv6 if the sender writes data that must be fragmented.dwhite2004-10-021-0/+14
| | | | | | | | | | | Discussed extensively with KAME. The API author's intent isn't clear at this point, so rather than remove the code entirely, #if 0 out and put a big comment in for now. The IPV6_RECVPATHMTU sockopt is available if the application wants to be notified of the path MTU to optimize packet sizes. Thanks to JINMEI Tatuya <jinmei@isl.rdc.toshiba.co.jp> for putting up with my incessant badgering on this issue, and fenner for pointing out the API issue and suggesting solutions.
* Add an additional struct inpcb * argument to pfil(9) in order to enablemlaier2004-09-293-3/+3
| | | | | | | | | | | | | | | | | | | passing along socket information. This is required to work around a LOR with the socket code which results in an easy reproducible hard lockup with debug.mpsafenet=1. This commit does *not* fix the LOR, but enables us to do so later. The missing piece is to turn the filter locking into a leaf lock and will follow in a seperate (later) commit. This will hopefully be MT5'ed in order to fix the problem for RELENG_5 in forseeable future. Suggested by: rwatson A lot of work by: csjp (he'd be even more helpful w/o mentor-reviews ;) Reviewed by: rwatson, csjp Tested by: -pf, -ipfw, LINT, csjp and myself MFC after: 3 days LOR IDs: 14 - 17 (not fixed yet)
* Prefer C99's __func__ over GCC's __FUNCTION__.stefanf2004-09-221-1/+1
|
* Call callout_init() on nd6_slowtimo_ch before setting it going; otherwise,rwatson2004-09-051-0/+1
| | | | | | | the flags field will be improperly initialized resulting in inconsistent operation (sometimes with Giant, sometimes without, et al). RELENG_5 candidate.
* Unlock rather than lock the ripcbinfo lock at the end of rip6_input().rwatson2004-09-021-1/+1
| | | | | | RELENG_5 candidate. Foot provided by: Patrick Guelat <pg at imp dot ch>
* Mark Netgraph TTY, KAME IPSEC, and IPX/SPX as requiring Giant for correctrwatson2004-08-281-0/+2
| | | | | | | operation using NET_NEEDS_GIANT(). This will result in a boot-time restoration of Giant-enabled network operation, or run-time warning on dynamic load (applicable only to the Netgraph component). Additional components will likely need to be marked with this in the future.
* Apply error and success logic consistently to the function netisr_queue() andandre2004-08-272-4/+4
| | | | | | | | | | | | | | | | | | its users. netisr_queue() now returns (0) on success and ERRNO on failure. At the moment ENXIO (netisr queue not functional) and ENOBUFS (netisr queue full) are supported. Previously it would return (1) on success but the return value of IF_HANDOFF() was interpreted wrongly and (0) was actually returned on success. Due to this schednetisr() was never called to kick the scheduling of the isr. However this was masked by other normal packets coming through netisr_dispatch() causing the dequeueing of waiting packets. PR: kern/70988 Found by: MOROHOSHI Akihiko <moro@remus.dti.ne.jp> MFC after: 3 days
* Always compile PFIL_HOOKS into the kernel and remove the associated kernelandre2004-08-274-32/+22
| | | | | | | | | | | compile option. All FreeBSD packet filters now use the PFIL_HOOKS API and thus it becomes a standard part of the network stack. If no hooks are connected the entire packet filter hooks section and related activities are jumped over. This removes any performance impact if no hooks are active. Both OpenBSD and DragonFlyBSD have integrated PFIL_HOOKS permanently as well.
* Remove in6_prefix.[ch] and the contained router renumbering capability.rwatson2004-08-237-1327/+0
| | | | | | | | | | | | The prefix management code currently resides in nd6, leaving only the unused router renumbering capability in the in6_prefix files. Removing it will make it easier for us to provide locking for the remainder of IPv6 by reducing the number of objects requiring synchronized access. This functionality has also been removed from NetBSD and OpenBSD. Submitted by: George Neville-Neil <gnn at neville-neil.com> Discussed with/approved by: suz, keiichi at kame.net, core at kame.net
* When notifying protocol components of an event on an in6pcb, use therwatson2004-08-211-3/+5
| | | | | | | | | | result of the notify() function to decide if we need to unlock the in6pcb or not, rather than always unlocking. Otherwise, we may unlock and already unlocked in6pcb. Reported by: kuriyama, Gordon Bergling <gbergling at 0xfce3.net> Tested by: kuriyama, Gordon Bergling <gbergling at 0xfce3.net> Discussed with: mdodd
* Get rid of the RANDOM_IP_ID option and make it a sysctl. NetBSDdwmalone2004-08-148-46/+1
| | | | | | | | | | | | | | | | | | | | | have already done this, so I have styled the patch on their work: 1) introduce a ip_newid() static inline function that checks the sysctl and then decides if it should return a sequential or random IP ID. 2) named the sysctl net.inet.ip.random_id 3) IPv6 flow IDs and fragment IDs are now always random. Flow IDs and frag IDs are significantly less common in the IPv6 world (ie. rarely generated per-packet), so there should be smaller performance concerns. The sysctl defaults to 0 (sequential IP IDs). Reviewed by: andre, silby, mlaier, ume Based on: NetBSD MFC after: 2 months
* When allocating the IPv6 header to stick in front of raw packet beingrwatson2004-08-121-1/+5
| | | | | | | sent via a raw IPv6 socket, use M_DONTWAIT not M_TRYWAIT, as we're holding the raw pcb mutex. Reported, tested by: kuriyama
* Pass pcbinfo structures to in6_pcbnotify() rather than pcbheadrwatson2004-08-064-8/+19
| | | | | | | | | | structures, allowing in6_pcbnotify() to lock the pcbinfo and each inpcb that it notifies of ICMPv6 events. This prevents inpcb assertions from firing when IPv6 generates and delievers event notifications for inpcbs. Reported by: kuriyama Tested by: kuriyama
* Disallow a particular kind of port theft described by the following scenario:yar2004-07-281-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Alice is too lazy to write a server application in PF-independent manner. Therefore she knocks up the server using PF_INET6 only and allows the IPv6 socket to accept mapped IPv4 as well. An evil hacker known on IRC as cheshire_cat has an account in the same system. He starts a process listening on the same port as used by Alice's server, but in PF_INET. As a consequence, cheshire_cat will distract all IPv4 traffic supposed to go to Alice's server. Such sort of port theft was initially enabled by copying the code that implemented the RFC 2553 semantics on IPv4/6 sockets (see inet6(4)) for the implied case of the same owner for both connections. After this change, the above scenario will be impossible. In the same setting, the user who attempts to start his server last will get EADDRINUSE. Of course, using IPv4 mapped to IPv6 leads to security complications in the first place, but there is no reason to make it even more unsafe. This change doesn't apply to KAME since it affects a FreeBSD-specific part of the code. It doesn't modify the out-of-box behaviour of the TCP/IP stack either as long as mapping IPv4 to IPv6 is off by default. MFC after: 1 month
* Commit a first pass at in6pcb and pcbinfo locking for IPv6,rwatson2004-07-273-35/+160
| | | | | | | | synchronizing IPv6 protocol control blocks and lists. These changes are modeled on the inpcb locking for IPv4, submitted by Jennifer Yang, and committed by Jeffrey Hsu. With these locking changes, IPv6 use of inpcbs is now substantially more MPSAFE, and permits IPv4 inpcb locking assertions to be run in the presence of IPv6 compiled into the kernel.
* Don't consider TCP connections beyond LISTEN stateyar2004-07-271-19/+10
| | | | | | | | | | | | (i.e. with the foreign address being not wildcard) when checking for possible port theft since such connections cannot be stolen. The port theft check is FreeBSD-specific and isn't in the KAME tree. PR: bin/65928 (in the audit trail) Reviewed by: -net, -hackers (silence) Tested by: Nick Leuta <skynick at mail.sc.ru> MFC after: 1 month
* Rename suser_cred()'s PRISON_ROOT flag to SUSER_ALLOWJAIL. This iscperciva2004-07-261-1/+1
| | | | | | | | | | | somewhat clearer, but more importantly allows for a consistent naming scheme for suser_cred flags. The old name is still defined, but will be removed in a few days (unless I hear any complaints...) Discussed with: rwatson, scottl Requested by: jhb
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPphk2004-07-151-0/+1
| | | | | | | | for unknown events. A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything".
* Link ALTQ to the build and break with ABI for struct ifnet. Please recompilemlaier2004-06-131-0/+6
| | | | | | | | | | | | your (network) modules as well as any userland that might make sense of sizeof(struct ifnet). This does not change the queueing yet. These changes will follow in a seperate commit. Same with the driver changes, which need case by case evaluation. __FreeBSD_version bump will follow. Tested-by: (i386)LINT
* Missed directory in previous commit; need to hold SOCK_LOCK(so)rwatson2004-06-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | before calling sotryfree(). -- Body of earlier bulk commit this belonged with -- Log: Extend coverage of SOCK_LOCK(so) to include so_count, the socket reference count: - Assert SOCK_LOCK(so) macros that directly manipulate so_count: soref(), sorele(). - Assert SOCK_LOCK(so) in macros/functions that rely on the state of so_count: sofree(), sotryfree(). - Acquire SOCK_LOCK(so) before calling these functions or macros in various contexts in the stack, both at the socket and protocol layers. - In some cases, perform soisdisconnected() before sotryfree(), as this could result in frobbing of a non-present socket if sotryfree() actually frees the socket. - Note that sofree()/sotryfree() will release the socket lock even if they don't free the socket. Submitted by: sam Sponsored by: FreeBSD Foundation Obtained from: BSD/OS
* do not check super user privilege in ip6_savecontrol. It isume2004-06-021-20/+5
| | | | | | | meaningless and can even be harmful. Obtained from: KAME MFC after: 3 days
* add missing #include <sys/module.h>phk2004-05-301-0/+1
|
* Fix a bug which I discovered recently while doing IPv6 testing atwpaul2004-05-141-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | Wind River. In the IPv4 output path, one of the tests in ip_output() checks how many slots are actually available in the interface output queue before attempting to send a packet. If, for example, we need to transmit a packet of 32K bytes over an interface with an MTU of 1500, we know it's going to take about 21 fragments to do it. If there's less than 21 slots left in the output queue, there's no point in transmitting anything at all: IP does not do retransmission, so sending only some of the fragments would just be a waste of bandwidth. (In an extreme case, if you're sending a heavy stream of fragmented packets, you might find yourself sending nothing by the first fragment of all your packets.) So if ip_output() notices there's not enough room in the output queue to send the frame, it just dumps the packet and returns ENOBUFS to the app. It turns out ip6_output() lacks this code. Consequently, this caused the netperf UDPIPV6_STREAM test to produce very poor results with large write sizes. This commit adds code to check the remaining space in the output queue and junk fragmented packets if they're too big to be sent, just like with IPv4. (I can't imagine anyone's running an NFS server using UDP over IPv6, but if they are, this will likely make them a lot happier. :)
* fix the change of interface in nd6_storelladdr for multicastluigi2004-04-261-5/+5
| | | | | | addresses too. Reported by: Jun Kuriyama
OpenPOWER on IntegriCloud