summaryrefslogtreecommitdiffstats
path: root/sys/netinet
Commit message (Collapse)AuthorAgeFilesLines
* Remove some code that snuck in by accident.ps2005-04-211-5/+0
| | | | Submitted by: Mohan Srinivasan
* Fix for interaction problems between TCP SACK and TCP Signature.ps2005-04-212-55/+106
| | | | | | | | | | | If TCP Signatures are enabled, the maximum allowed sack blocks aren't going to fit. The fix is to compute how many sack blocks fit and tack these on last. Also on SYNs, defer padding until after the SACK PERMITTED option has been added. Found by: Mohan Srinivasan. Submitted by: Mohan Srinivasan, Noritoshi Demizu. Reviewed by: Raja Mukerji.
* Undo rev 1.71 as it is the wrong change.ps2005-04-211-10/+7
|
* - Make the sack scoreboard logic use the TAILQ macros. This improvesps2005-04-214-80/+44
| | | | | | | | | code readability and facilitates some anticipated optimizations in tcp_sack_option(). - Remove tcp_print_holes() and TCP_SACK_DEBUG. Submitted by: Raja Mukerji. Reviewed by: Mohan Srinivasan, Noritoshi Demizu.
* Fix for 2 bugs related to TCP Signatures :ps2005-04-211-7/+10
| | | | | | | | | | - If the peer sends the Signature option in the SYN, use of Timestamps and Window Scaling were disabled (even if the peer supports them). - The sender must not disable signatures if the option is absent in the received SYN. (See comment in syncache_add()). Found, Submitted by: Noritoshi Demizu <demizu at dd dot ij4u dot or dot jp>. Reviewed by: Mohan Srinivasan <mohans at yahoo-inc dot com>.
* Move Path MTU discovery ICMP processing from icmp_input() toandre2005-04-214-59/+74
| | | | | | | | | | | | | | | | | | | | tcp_ctlinput() and subject it to active tcpcb and sequence number checking. Previously any ICMP unreachable/needfrag message would cause an update to the TCP hostcache. Now only ICMP PMTU messages belonging to an active TCP session with the correct src/dst/port and sequence number will update the hostcache and complete the path MTU discovery process. Note that we don't entirely implement the recommended counter measures of Section 7.2 of the paper. However we close down the possible degradation vector from trivially easy to really complex and resource intensive. In addition we have limited the smallest acceptable MTU with net.inet.tcp.minmss sysctl for some time already, further reducing the effect of any degradation due to an attack. Security: draft-gont-tcpm-icmp-attacks-03.txt Section 7.2 MFC after: 3 days
* Ignore ICMP Source Quench messages for TCP sessions. Source Quench isandre2005-04-214-51/+23
| | | | | | | | | | | ineffective, depreciated and can be abused to degrade the performance of active TCP sessions if spoofed. Replace a bogus call to tcp_quench() in tcp_output() with the direct equivalent tcpcb variable assignment. Security: draft-gont-tcpm-icmp-attacks-03.txt Section 7.1 MFC after: 3 days
* Remove anti-LOR bandaid, it is not needed now.glebius2005-04-201-21/+0
| | | | Sponsored by: Rambler
* Make DUMMYNET compile without INET6phk2005-04-191-0/+8
|
* typophk2005-04-191-1/+1
|
* Make IPFIREWALL compile without INET6phk2005-04-191-3/+18
|
* Add IPv6 support to IPFW and Dummynet.brooks2005-04-185-48/+505
| | | | Submitted by: Mariano Tortoriello and Raffaele De Lorenzo (via luigi)
* Rewrite of tcp_update_sack_list() to make it simpler and more readableps2005-04-181-74/+67
| | | | | | | than our original OpenBSD derived version. Submitted by: Noritoshi Demizu Reviewed by: Mohan Srinivasan, Raja Mukerji
* Centralized finding the protocol header in IP packets in preperation forbrooks2005-04-151-92/+109
| | | | | | | IPv6 support. The header in IPv6 is more complex then in IPv4 so we want to handle skipping over it in one location. Submitted by: Mariano Tortoriello and Raffaele De Lorenzo (via luigi)
* Fix for a TCP SACK bug where more than (win/2) bytes could have beenps2005-04-144-3/+76
| | | | | | | | | in flight in SACK recovery. Found by: Noritoshi Demizu Submitted by: Mohan Srinivasan <mohans at yahoo-inc dot com> Noritoshi Demizu <demizu at dd dot ij4u dot or dot jp> Raja Mukerji <raja at moselle dot com>
* - Tighten up the Timestamp checks to prevent a spoofed segment fromps2005-04-103-6/+47
| | | | | | | | | | setting ts_recent to an arbitrary value, stopping further communication between the two hosts. - If the Echoed Timestamp is greater than the current time, fall back to the non RFC 1323 RTT calculation. Submitted by: Raja Mukerji (raja at moselle dot com) Reviewed by: Noritoshi Demizu, Mohan Srinivasan
* - If the reassembly queue limit was reached or if we couldn't allocateps2005-04-104-2/+8
| | | | | | | | | | | a reassembly queue state structure, don't update (receiver) sack report. - Similarly, if tcp_drain() is called, freeing up all items on the reassembly queue, clean the sack report. Found, Submitted by: Noritoshi Demizu <demizu at dd dot iij4u dot or dot jp> Reviewed by: Mohan Srinivasan (mohans at yahoo-inc dot com), Raja Mukerji (raja at moselle dot com).
* When the rightmost SACK block expands, rcv_lastsack should be updated.ps2005-04-101-0/+2
| | | | | | | | (Fix for kern/78226). Submitted by : Noritoshi Demizu <demizu at dd dot iij4u dot or dot jp> Reviewed by : Mohan Srinivasan (mohans at yahoo-inc dot com), Raja Mukerji (raja at moselle dot com).
* Remove some unused sack fields.ps2005-04-101-3/+0
| | | | Submitted by : Noritoshi Demizu, Mohan Srinivasan.
* o Nano optimize ip_reass() code path for the first fragment: do notmaxim2005-04-081-5/+3
| | | | | | | | | | | | try to reasseble the packet from the fragments queue with the only fragment, finish with the first fragment as soon as we create a queue. Spotted by: Vijay Singh o Drop the fragment if maxfragsperpacket == 0, no chances we will be able to reassemble the packet in future. Reviewed by: silby
* o Tweak the comment a bit.maxim2005-04-081-1/+1
|
* o Disable random port allocation when ip.portrange.first ==maxim2005-04-081-0/+6
| | | | | | | | | | | | ip.portrange.last and there is the only port for that because: a) it is not wise; b) it leads to a panic in the random ip port allocation code. In general we need to disable ip port allocation randomization if the last - first delta is ridiculous small. PR: kern/79342 Spotted by: Anjali Kulkarni Glanced at by: silby MFC after: 2 weeks
* When a packet has been reinjected into ipfw(4) after dummynet(4) processingglebius2005-04-061-2/+6
| | | | | | | | | | | | | | | | we have a non-NULL args.rule. If the same packet later is subject to "tee" rule, its original is sent again into ipfw_chk() and it reenters at the same rule. This leads to infinite loop and frozen router. Assign args.rule to NULL, any time we are going to send packet back to ipfw_chk() after a tee rule. This is a temporary workaround, which we will leave for RELENG_5. In HEAD we are going to make divert(4) save next rule the same way as dummynet(4) does. PR: kern/79546 Submitted by: Oleg Bulyzhin Reviewed by: maxim, andre MFC after: 3 days
* Use ACTION_PTR(r) instead of (r->cmd + r->act_ofs).brooks2005-04-061-2/+2
| | | | Reviewed by: md5
* Make dummynet_flush() match its prototype.brooks2005-04-051-1/+1
|
* natd core dumps when -reverse switch is used because of a bug inphk2005-04-051-2/+2
| | | | | | | | | | | | | | | | | | | | | libalias. In /usr/src/lib/libalias/alias.c, the functions LibAliasIn and LibAliasOutTry call the legacy PacketAliasIn/PacketAliasOut instead of LibAliasIn/LibAliasOut when the PKT_ALIAS_REVERSE option is set. In this case, the context variable "la" gets lost because the legacy compatibility routines expect "la" to be global. This was obviously an oversight when rewriting the PacketAlias* functions to the LibAlias* functions. The fix (as shown in the patch below) is to remove the legacy subroutine calls and replace with the new ones using the "la" struct as the first arg. Submitted by: Gil Kloepfer <fgil@kloepfer.org> Confirmed by: <nicolai@catpipe.net> PR: 76839 MFC after: 3 days
* When several carp interfaces are attached to Ethernet interface,glebius2005-03-301-27/+37
| | | | | | | | | | | | carp_carpdev_state_locked() is called every time carp interface is attached. The first call backs up flags of the first interface, and the second call backs up them again, erasing correct values. To solve this, a carp_sc_state_locked() function is introduced. It is called when interface is attached to parent, instead of calling carp_carpdev_state_locked. carp_carpdev_state_locked() calls carp_sc_state_locked() for each sc in chain. Reported by: Yuriy N. Shkandybin, sem
* - Don't free mbuf, passed to interface output method if the latterglebius2005-03-291-2/+1
| | | | | | | | | | returns error. In this case mbuf has already been freed. [1] - Remove redundant declaration. PR: kern/78893 [1] Submitted by: Liang Yi [1] Reviewed by: sam MFC after: 1 day
* eliminate extraneous null ptr checkssam2005-03-293-5/+5
| | | | Noticed by: Coverity Prevent analysis tool
* deal with malloc failuressam2005-03-261-7/+16
| | | | | Noticed by: Coverity Prevent analysis tool Together with: mdodd
* o Document net.inet.ip.portrange.random* sysctls.maxim2005-03-231-7/+10
| | | | | | | | o Correct a comment about random port allocation threshold implementation. Reviewed by: silby, ru MFC after: 3 days
* ifma_protospec is a pointer. Use NULL when assigning or compating it.glebius2005-03-201-2/+2
|
* Remove a workaround from previos revision. It proved to be incorrect.glebius2005-03-201-7/+16
| | | | | | | | Add two another workarounds for carp(4) interfaces: - do not add connected route when address is assigned to carp(4) interface - do not add connected route when other interface goes down Embrace workarounds with #ifdef DEV_CARP
* If vhid exists return more informative EEXIST instead of EINVAL. While hereglebius2005-03-181-3/+2
| | | | remove redundant brackets.
* Fix a potential crash that could occur when CARP_LOG is being used.glebius2005-03-181-2/+1
| | | | Obtained from: OpenBSD (pat)
* plug resource leaksam2005-03-161-1/+3
| | | | Noticed by: Coverity Prevent analysis tool
* In tcp_usr_send(), broaden coverage of the socket buffer lock in therwatson2005-03-141-1/+4
| | | | | | | non-OOB case so that the sbspace() check is performed under the same lock instance as the append to the send socket buffer. MFC after: 1 week
* Embrace with #ifdef DEV_CARP carp-related code.glebius2005-03-131-2/+7
|
* Add antifootshooting workaround, which will make all routes "connected"glebius2005-03-101-0/+6
| | | | | to carp(4) interfaces host routes. This prevents a problem, when connected network is routed to carp(4) interface.
* Add limits on the number of elements in the sack scoreboard bothps2005-03-092-3/+42
| | | | | | | | per-connection and globally. This eliminates potential DoS attacks where SACK scoreboard elements tie up too much memory. Submitted by: Raja Mukerji (raja at moselle dot com). Reviewed by: Mohan Srinivasan (mohans at yahoo-inc dot com).
* Make ARP do not complain about wrong interface if correct interfaceglebius2005-03-091-7/+14
| | | | | | is a carp one and address matched it. Reviewed by: brooks
* Fix a problem in the Skinny ALG where a specially crafted packet could causemarcus2005-03-031-4/+4
| | | | | | | | | a libalias application (e.g. natd, ppp, etc.) to crash. Note: Skinny support is not enabled in natd or ppp by default. Approved by: secteam (nectar) MFC after: 1 day Secuiryt: This fixes a remote DoS exploit
* Fix typo. Unbreak build. Take pointy hat.glebius2005-03-021-1/+1
|
* Add more locking when reading/writing to carp softc. When carp softc isglebius2005-03-011-31/+140
| | | | | | | | | | | | | | attached to a parent interface we use its mutex to lock the softc. This means that in several places like carp_ioctl() we lock softc conditionaly. This should be redesigned. To avoid LORs when MII announces us a link state change, we schedule a quick callout and call carp_carpdev_state_locked() from it. Initialize callouts using NET_CALLOUT_MPSAFE. Sponsored by: Rambler Reviewed by: mlaier
* - Add carp_mtx. Use it to protect list of all carp interfaces.glebius2005-03-011-18/+20
| | | | | | | | - In carp_send_ad_all() walk through list of all carp interfaces instead of walking through list of all interfaces. Sponsored by: Rambler Reviewed by: mlaier
* Use NET_CALLOUT_MPSAFE macro.glebius2005-03-016-25/+17
|
* Revert change to struct ifnet. Use ifnet pointer in softc. Embeddingglebius2005-03-011-1/+1
| | | | | | ifnet into smth will soon be removed. Requested by: brooks
* Remove debugging printf.glebius2005-03-011-1/+0
| | | | Reviewed by: mlaier
* Support running carp(4) over a vlan(4) parent interface.yar2005-02-281-1/+2
| | | | Encouraged by: glebius
* Remove unused field from carp softc.glebius2005-02-281-3/+0
| | | | OK'ed by: mcbride@OpenBSD
OpenPOWER on IntegriCloud