summaryrefslogtreecommitdiffstats
path: root/sys/netinet
Commit message (Collapse)AuthorAgeFilesLines
* Fix kmod_*stat_inc() after r249276. The incorrect code actuallyglebius2013-06-212-3/+3
| | | | | | | | increased the pointer, not the memory it points to. In collaboration with: kib Reported & tested by: Ian FREISLICH <ianf clue.co.za> Sponsored by: Nginx, Inc.
* Use IPSECSTAT_INC() and IPSEC6STAT_INC() macros for ipsec statisticsae2013-06-202-6/+6
| | | | | | accounting. MFC after: 2 weeks
* Disable IGMPv3 link timers on a transition to IGMPv2.bms2013-06-071-0/+1
| | | | Submitted by: Alan Smithee
* Allow drivers to specify a maximum TSO length in bytes if they areandre2013-06-034-20/+37
| | | | | | | | | | | | | | | | | | | | | | | limited in the amount of data they can handle at once. Drivers can set ifp->if_hw_tsomax before calling ether_ifattach() to change the limit. The lowest allowable size is IP_MAXPACKET / 8 (8192 bytes) as anything less wouldn't be very useful anymore. The upper limit is still at IP_MAXPACKET (65536 bytes). Raising it requires further auditing of the IPv4/v6 code path's as the length field in the IP header would overflow leading to confusion in firewalls and others packet handler on the real size of the packet. The placement into "struct ifnet" is a bit hackish but the best place that was found. When the stack/driver boundary is updated it should be handled in a better way. Submitted by: cperciva (earlier version) Reviewed by: cperciva Tested by: cperciva MFC after: 1 week (using spare struct members to preserve ABI)
* Use LIST_EMPTY when appropriate.tuexen2013-06-021-2/+2
| | | | MFC after: 1 week
* Remove redundant checks.tuexen2013-05-281-6/+6
| | | | MFC after: 2 weeks
* Withdraw http://svnweb.freebsd.org/changeset/base/250809tuexen2013-05-241-2/+0
| | | | since the real fix is in http://svnweb.freebsd.org/changeset/base/250952.
* Initialize the fibnum for outgoing packets to 0. This avoidstuexen2013-05-191-0/+2
| | | | | | | | crashing due to the usage of uninitialized fibnum. This bugs became visiable after http://svnweb.freebsd.org/changeset/base/250700 MFC after: 2 weeks
* Set errno to ETIMEDOUT if an SCTP association times out duringtuexen2013-05-171-2/+8
| | | | | | setup. MFC after: 1 week
* Don't send an ABORT chunk with verification 0.tuexen2013-05-171-2/+10
| | | | MFC after: 1 week
* Fix typo in net.inet.tcp.minmss sysctl description.jimharris2013-05-131-1/+1
| | | | MFC after: 3 days
* Add IFF_MONITOR support to gre(4).hrs2013-05-111-0/+10
| | | | | Tested by: Chip Marshall MFC after: 1 week
* Rate limit the number of remotely triggered ARP log messagesglebius2013-05-111-13/+24
| | | | to 1 log message per second.
* Honor the net.inet6.ip6.v6only sysctl variable and the IPV6_V6ONLYtuexen2013-05-101-2/+7
| | | | | | | socket option for SCTP sockets in the same way as for UDP or TCP sockets. MFC after: 2 weeks
* Back out r249318, r249320 and r249327 due to a heisenbug mostandre2013-05-065-6/+6
| | | | | likely related to a race condition in the ipi_hash_lock with the exact cause currently unknown but under investigation.
* Use FF02:0:0:0:0:2:FF00::/104 prefix for IPv6 Node Information Grouphrs2013-05-041-1/+2
| | | | | | | | | | | | | | | | | | Address. Although KAME implementation used FF02:0:0:0:0:2::/96 based on older versions of draft-ietf-ipngwg-icmp-name-lookup, it has been changed in RFC 4620. The kernel always joins the /104-prefixed address, and additionally does /96-prefixed one only when net.inet6.icmp6.nodeinfo_oldmcprefix=1. The default value of the sysctl is 1. ping6(8) -N flag now uses /104-prefixed one. When this flag is specified twice, it uses /96-prefixed one instead. Reviewed by: ume Based on work by: Thomas Scheffler PR: conf/174957 MFC after: 2 weeks
* Move IPPROTO_IPV6 from #ifdef __BSD_VISIBLE to #if __POSIX_VISIBLE >= 201112cperciva2013-04-271-1/+1
| | | | | | | | since POSIX 2001 states that it shall be defined. Reported by: sbruno Reviewed by: jilles MFC after: 1 week
* Add const qualifier to the dst parameter of the ifnet if_output method.glebius2013-04-267-27/+29
|
* Fix couple of mbuf leaks in incoming ARP processing.glebius2013-04-251-2/+2
|
* Introduce a pointer to const variable gw, which points either at theglebius2013-04-251-13/+6
| | | | | | | | | | | same place as dst, or to the sockaddr in the routing table. The const constraint of gw makes us safe from modifing routing table accidentially. And "onstantness" of dst allows us to remove several bandaids, when we switched it back at &ro->ro_dst, now it always points there. Reviewed by: rrs
* This fixes the issue with the "randomly changing" defaultrrs2013-04-241-1/+1
| | | | | | | | | | | | | | | | route. What it was is there are two places in ip_output.c where we do a goto again. One place was fine, it copies out the new address and then resets dst = ro->rt_dst; But the other place does *not* do that, which means earlier when we found the gateway, we have dst pointing there aka dst = ro->rt_gateway is done.. then we do a goto again.. bam now we clobber the default route. The fix is just to move the again so we are always doing dst = &ro->rt_dst; in the again loop. PR: 174749,157796 MFC after: 1 week
* When doing RFC3042 limited transmit on the first on secondandre2013-04-231-1/+12
| | | | | | | | | duplicate ACK make sure we actually have new data to send. This prevents us from sending unneccessary pure ACKs. Reported by: Matt Miller <matt@matthewjmiller.net> Tested by: Matt Miller <matt@matthewjmiller.net> MFC after: 2 weeks
* Plug static llentry leak (ipv4 & ipv6 were affected).oleg2013-04-211-2/+6
| | | | | PR: kern/172985 MFC after: 1 month
* - Corrrect mispellings of word usefulgabor2013-04-171-1/+1
| | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de> (via private mail)
* Fix incomplete printf.delphij2013-04-161-1/+2
| | | | | | PR: kern/177889 Submitted by: Sven-Thorsten Dietrich <sven vyatta com> MFC after: 1 week
* Don't leak lock when returning.delphij2013-04-161-0/+1
| | | | | | PR: kern/177888 Submitted by: Sven-Thorsten Dietrich <sven vyatta com> MFC after: 1 week
* Reflect removing of the counter_u64_subtract() function in the macro.ae2013-04-121-2/+2
|
* Fix tcp_output() so that tcpcb is updated in the same manner when anglebius2013-04-111-70/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | mbuf allocation fails, as in a case when ip_output() returns error. To achieve that, move large block of code that updates tcpcb below the out: label. This fixes a panic, that requires the following sequence to happen: 1) The SYN was sent to the network, tp->snd_nxt = iss + 1, tp->snd_una = iss 2) The retransmit timeout happened for the SYN we had sent, tcp_timer_rexmt() sets tp->snd_nxt = tp->snd_una, and calls tcp_output(). In tcp_output m_get() fails. 3) Later on the SYN|ACK for the SYN sent in step 1) came, tcp_input sets tp->snd_una += 1, which leads to tp->snd_una > tp->snd_nxt inconsistency, that later panics in socket buffer code. For reference, this bug fixed in DragonflyBSD repo: http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1ff9b7d322dc5a26f7173aa8c38ecb79da80e419 Reviewed by: andre Tested by: pho Sponsored by: Nginx, Inc. PR: kern/177456 Submitted by: HouYeFei&XiBoLiu <lglion718 163.com>
* Fix build.glebius2013-04-101-1/+1
|
* Change certain heavily used network related mutexes and rwlocks toandre2013-04-094-5/+5
| | | | | | | | | | reside on their own cache line to prevent false sharing with other nearby structures, especially for those in the .bss segment. NB: Those mutexes and rwlocks with variables next to them that get changed on every invocation do not benefit from their own cache line. Actually it may be net negative because two cache misses would be incurred in those cases.
* Fix a race condition on tcp listen socket teardown with pendingandre2013-04-091-0/+9
| | | | | | | | | | | | | | connections in the accept queue and contiguous new incoming SYNs. Compared to the original submitters patch I've moved the test next to the SYN handling to have it together in a logical unit and reworded the comment explaining the issue. Submitted by: Matt Miller <matt@matthewjmiller.net> Submitted by: Juan Mojica <jmojica@gmail.com> Reviewed by: Matt Miller (changes) Tested by: pho MFC after: 1 week
* Fix VIMAGE build.glebius2013-04-091-2/+2
|
* Use IP6STAT_INC/IP6STAT_DEC macros to update ip6 stats.ae2013-04-091-4/+4
| | | | MFC after: 1 week
* Merge from projects/counters: TCP/IP stats.glebius2013-04-084-165/+420
| | | | | | | | | Convert 'struct ipstat' and 'struct tcpstat' to counter(9). This speeds up IP forwarding at extreme packet rates, and makes accounting more precise. Sponsored by: Nginx, Inc.
* Add a macro for checking for IPv4 link local addresses.tuexen2013-03-311-0/+4
| | | | MFC after: 1 week
* Keep fwd_tag around for subsequent pcb lookupsemaste2013-03-291-17/+8
| | | | | | | | | | For TIMEWAIT handling tcp_input may have to jump back for an additional pass through pcblookup. Prior to this change the fwd_tag had been discarded after the first lookup, so a new connection attempt delivered locally via 'ipfw fwd' would fail to find a match. As of r248886 the tag will be detached and freed when passed to the socket buffer.
* Add ipfw support for setting/matching DiffServ codepoints (DSCP).melifaro2013-03-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | Setting DSCP support is done via O_SETDSCP which works for both IPv4 and IPv6 packets. Fast checksum recalculation (RFC 1624) is done for IPv4. Dscp can be specified by name (AFXY, CSX, BE, EF), by value (0..63) or via tablearg. Matching DSCP is done via another opcode (O_DSCP) which accepts several classes at once (af11,af22,be). Classes are stored in bitmask (2 u32 words). Many people made their variants of this patch, the ones I'm aware of are (in alphabetic order): Dmitrii Tejblum Marcelo Araujo Roman Bogorodskiy (novel) Sergey Matveichuk (sem) Sergey Ryabin PR: kern/102471, kern/121122 MFC after: 2 weeks
* In m_megapullup() instead of reserving some space at the end of packet,glebius2013-03-171-10/+6
| | | | | | m_align() it, reserving space to prepend data. Reviewed by: mav
* - Replace compat macros with function calls.glebius2013-03-163-3/+3
|
* We can, and should use M_WAITOK here.glebius2013-03-151-1/+1
| | | | Sponsored by: Nginx, Inc.
* Use m_get/m_gethdr instead of compat macros.glebius2013-03-156-11/+10
| | | | Sponsored by: Nginx, Inc.
* - Use m_getcl() instead of hand allocating.glebius2013-03-151-12/+8
| | | | Sponsored by: Nginx, Inc.
* Functions m_getm2() and m_get2() have different order of arguments,glebius2013-03-121-1/+1
| | | | | | | and that can drive someone crazy. While m_get2() is young and not documented yet, change its order of arguments to match m_getm2(). Sorry for churn, but better now than later.
* Remove LIBALIAS_LOCK_ASSERT(), including a couple with an uninitialzedglebius2013-03-111-6/+1
| | | | | | | argument, in code that isn't compiled in kernel. PR: kern/176667 Sponsored by: Nginx, Inc.
* The hashmask returned by hashinit() is a valid index in the returned hash array.lstewart2013-03-071-1/+1
| | | | | | | | Fix a siftr(4) potential memory leak and INVARIANTS triggered kernel panic in hashdestroy() by ensuring the last array index in the flow counter hash table is flushed of entries. MFC after: 3 days
* - Make callout(9) tickless, relying on eventtimers(4) as backend fordavide2013-03-041-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | precise time event generation. This greatly improves granularity of callouts which are not anymore constrained to wait next tick to be scheduled. - Extend the callout KPI introducing a set of callout_reset_sbt* functions, which take a sbintime_t as timeout argument. The new KPI also offers a way for consumers to specify precision tolerance they allow, so that callout can coalesce events and reduce number of interrupts as well as potentially avoid scheduling a SWI thread. - Introduce support for dispatching callouts directly from hardware interrupt context, specifying an additional flag. This feature should be used carefully, as long as interrupt context has some limitations (e.g. no sleeping locks can be held). - Enhance mechanisms to gather informations about callwheel, introducing a new sysctl to obtain stats. This change breaks the KBI. struct callout fields has been changed, in particular 'int ticks' (4 bytes) has been replaced with 'sbintime_t' (8 bytes) and another 'sbintime_t' field was added for precision. Together with: mav Reviewed by: attilio, bde, luigi, phk Sponsored by: Google Summer of Code 2012, iXsystems inc. Tested by: flo (amd64, sparc64), marius (sparc64), ian (arm), markj (amd64), mav, Fabian Keil
* Fix a potential race in returning setting errno when antuexen2013-02-271-1/+2
| | | | | | | | association goes down. Reported by Mozilla in https://bugzilla.mozilla.org/show_bug.cgi?id=845513 MFC after: 3 days
* Fix tcp_lro_rx_ipv4() for drivers that do not set CSUM_IP_CHECKED.gallatin2013-02-211-1/+1
| | | | | | | | | | | Specifcially, in_cksum_hdr() returns 0 (not 0xffff) when the IPv4 checksum is correct. Without this fix, the tcp_lro code will reject good IPv4 traffic from drivers that do not implement IPv4 header harder csum offload. Sponsored by: Myricom Inc. MFC after: 7 days
* ip_savecontrol() style fixes. No functional changes.pluknet2013-02-201-17/+17
| | | | | | | | | - fix indentation - put the operator at the end of the line for long statements - remove spaces between the type and the variable in a cast - remove excessive parentheses Tested by: md5
* Send the adaptation layer indication only if set by the user.tuexen2013-02-114-19/+26
| | | | | MFC after: 3 days Discussed with: rrs
OpenPOWER on IntegriCloud