summaryrefslogtreecommitdiffstats
path: root/sys/netinet
Commit message (Collapse)AuthorAgeFilesLines
* Fix PAWS (Protect Against Wrapped Sequence numbers) in cases whenbz2012-02-155-23/+54
| | | | | | | | | | | | | | | | | | | | hz >> 1000 and thus getting outside the timestamp clock frequenceny of 1ms < x < 1s per tick as mandated by RFC1323, leading to connection resets on idle connections. Always use a granularity of 1ms using getmicrouptime() making all but relevant callouts independent of hz. Use getmicrouptime(), not getmicrotime() as the latter may make a jump possibly breaking TCP nfsroot mounts having our timestamps move forward for more than 24.8 days in a second without having been idle for that long. PR: kern/61404 Reviewed by: jhb, mav, rrs Discussed with: silby, lstewart Sponsored by: Sandvine Incorporated (originally in 2011) MFC after: 6 weeks
* Fix a bug where the wrong protocol overhead was used. This can leadtuexen2012-02-141-25/+62
| | | | | | | | | to a deadlock of an association when an IPv6 socket was used to communcate with IPv4 and an ICMPv4 fragmentation needed message was received. While there, simplify the code a bit. MFC after: 3 days.
* Set vnet context in callouts and taskqueues.glebius2012-02-081-0/+8
| | | | PR: 164696
* Make the 'tcpwin' option of ipfw(8) accept ranges and lists.glebius2012-02-062-3/+17
| | | | Submitted by: sem
* Fix a typo which was already fixed by eadler in r227489. We missedtuexen2012-02-061-1/+1
| | | | | | to integrate this fix in our code base, so it was removed in r227755. MFC after: 3 days.
* Add new socket options: TCP_KEEPINIT, TCP_KEEPIDLE, TCP_KEEPINTVL andglebius2012-02-057-24/+103
| | | | | | | TCP_KEEPCNT, that allow to control initial timeout, idle time, idle re-send interval and idle send count on a per-socket basis. Reviewed by: andre, bz, lstewart
* o Provide functions carp_ifa_addroute()/carp_ifa_delroute()glebius2012-02-011-24/+41
| | | | | | | | | | to cleanup routes from a single ifa. o Implement carp_addroute()/carp_delroute() via above functions. o Call carp_ifa_delroute() in the carp_detach() to avoid junk routes left in routing table, in case if user removes an address in a MASTER state. [1] Reported by: az [1]
* a variable was erroneously declared as 32 bit instead of 64.luigi2012-01-271-1/+1
| | | | MFC after: 3 days
* Remove unused variable.glebius2012-01-241-3/+0
|
* Make #error messages string-literals and remove punctuation.bz2012-01-223-3/+3
| | | | | | Reported by: bde (for ip_divert) Reviewed by: bde MFC after: 3 days
* Fix ip_divert handling of inet and inet6 and module building some more.bz2012-01-221-3/+1
| | | | | | | | Properly sort the "carp" case in modules/Makefile after it was renamed. Reported by: bde (most) Reviewed by: bde MFC after: 3 days
* Clean up some #endif comments removing from short sections. Add #endifbz2012-01-223-15/+14
| | | | | | | | | | | | comments to longer, also refining strange ones. Properly use #ifdef rather than #if defined() where possible. Four #if defined(PCBGROUP) occurances (netinet and netinet6) were ignored to avoid conflicts with eventually upcoming changes for RSS. Reported by: bde (most) Reviewed by: bde MFC after: 3 days
* Remove a superfluous INET6 check (no opt_inet6.h included anyway).bz2012-01-201-1/+1
| | | | MFC after: 3 days
* Fix a problem when using the CBAPI.tuexen2012-01-201-2/+1
| | | | While there, remove an old comment which does not apply anymore.
* Drop support for SIOCSIFADDR, SIOCSIFNETMASK, SIOCSIFBRDADDR, SIOCSIFDSTADDRglebius2012-01-161-76/+6
| | | | | | | ioctl commands. PR: 163524 Reviewed by: net
* Two cleanups. No functional change.tuexen2012-01-152-3/+3
|
* Fix two bugs, which result in a panic when calling getsockopt()tuexen2012-01-141-2/+2
| | | | | | | using SCTP_RECVINFO or SCTP_NXTINFO. Reported by Clement Lecigne and forwarded to us by zi@. MFC after: 3 days.
* Bunch of fixes to pfsync(4) module load/unload:glebius2012-01-091-20/+0
| | | | | | | | | | | | | | | | | | | | | o Make the pfsync.ko actually usable. Before this change loading it didn't register protosw, so was a nop. However, a module /boot/kernel did confused users. o Rewrite the way we are joining multicast group: - Move multicast initialization/destruction to separate functions. - Don't allocate memory if we aren't going to join a multicast group. - Use modern API for joining/leaving multicast group. - Now the utterly wrong pfsync_ifdetach() isn't needed. o Move module initialization from SYSINIT(9) to moduledata_t method. o Refuse to unload module, unless asked forcibly. o Improve a bit some FreeBSD porting code: - Use separate malloc type. - Simplify swi sheduling. This change is probably wrong from VIMAGE viewpoint, however pfsync wasn't VIMAGE-correct before this change, too. Glanced at by: bz
* Make it possible to use alternative source hardware addressglebius2012-01-081-10/+19
| | | | | | | | | | | | | in the ARP datagram generated by arprequest(). If caller doesn't supply the address, then it is either picked from CARP or hardware address of the interface is taken. While here, make several minor fixes: - Hold IF_ADDR_RLOCK(ifp) while traversing address list. - Remove not true comment. - Access internet address and mask via in_ifaddr fields, rather than ifaddr.
* Provide IA_MASKSIN() macro similar to IA_SIN() and IA_DSTSIN().glebius2012-01-081-0/+1
|
* Move arprequest() declaration to if_ether.h.glebius2012-01-082-2/+2
|
* Add an SCTP sysctl "blackhole", similar to the one for TCP.tuexen2012-01-084-5/+32
| | | | | | | | | | If set to 1, no ABORT is sent back in response to an incoming INIT. If set to 2, no ABORT is sent back in response to an out of the blue packet. If set to 0 (the default), ABORTs are sent. Discussed with rrs@. MFC after: 1 month.
* Retire the SCTP sysctl "strict_init". We always perform the validationtuexen2012-01-073-16/+3
| | | | | and there is no reason to make is configuarable. Discussed with rrs@.
* Improve the handling of received INITs. Send an ABORT whentuexen2012-01-071-100/+65
| | | | | | | not accepting the connection. Also fix a crash, which could happen when the user closed the socket. MFC after: 1 month.
* - Fix sysctl descriptioneadler2012-01-071-1/+1
| | | | | | PR: 163623 Submitted by: Eugene Grosbein <eugen@eg.sd.rdtc.ru> Approved by: bz
* Use NULL instead of 0.tuexen2012-01-061-1/+1
| | | | MFC after: 1 month.
* Always release the inp lock before returning from tcp_detach.np2012-01-061-1/+3
| | | | MFC after: 5 days
* Tweak the last fix to match what was actually tested.jhb2012-01-061-1/+1
| | | | Pointy hat to: jhb
* Fix a typo.pluknet2012-01-061-1/+1
| | | | X-MFC-with: 229665
* Remove the assertion from tcp_input() that rcv_nxt is always greaterjhb2012-01-052-7/+4
| | | | | | | | | | | | | | | | | than or equal to rcv_adv and fix tcp_twstart() to handle this case by assuming the last window was zero rather than a negative value. The code in tcp_input() already safely handled this case. It can happen due to delayed ACKs along with a remote sender that sends data beyond the window we previously advertised. If we have room in our socket buffer for the extra data beyond the advertised window, we will accept it. However, if the ACK for that segment is delayed, then we will not effectively fixup rcv_adv to account for that extra data until the next segment arrives and forces out an ACK. When that next segment arrives, rcv_nxt will be beyond rcv_adv. Tested by: pjd MFC after: 1 week
* Convert all users of IF_ADDR_LOCK to use new locking macros that specifyjhb2012-01-0510-71/+71
| | | | | | | either a read lock or write lock. Reviewed by: bz MFC after: 2 weeks
* Use a helper variable to wrap a long line.jhb2012-01-041-1/+2
|
* In the handling of the SIOC[DG]LIFADDR icotls in in_lifaddr_ioctl(), addjhb2012-01-041-0/+6
| | | | | | | | | missing interface address list locking and grab a reference on the matching interface address after dropping the lock while it is used to avoid a potential use after free. Reviewed by: bz MFC after: 1 week
* Fix the SIOC[DG]LIFADDR ioctls in in_lifaddr_ioctl() to work with IPv4jhb2012-01-041-3/+3
| | | | | | | | interface address rather than IPv6. Submitted by: hrs Reviewed by: bz MFC after: 1 week
* When cancelling multicast timers on an interface, don't release thejhb2012-01-031-8/+6
| | | | | | | | | | | | | | | | reference on a group in the leaving state while iterating over the loop. Instead, use the same approach used in igmp_ifdetach() and mld_ifdetach() of placing the groups to free on pending release list and then releasing the references after dropping the IF_ADDR_LOCK. This closes an ugly race where the code was dropping the lock in the middle of iterating over the list. It also fixes some additional potential use-after-free bugs since the cancellation routine also applied other changes to the group after dropping the reference. Now those changes are performed before the reference is dropped and the group is potentially freed. Prodded to fix by: glebius Reviewed by: bz MFC after: 1 week
* Use TAILQ_FOREACH() instead of TAILQ_FOREACH_SAFE() for some loops thatjhb2012-01-031-5/+4
| | | | | | do not modify the queues they iterate over. Submitted by: glebius
* As I came by and noticed add a comment that inp locking is a bit optisticbz2012-01-021-0/+2
| | | | (read: non-existent) here and should be fixed.
* Defer the work of freeing IPv4 multicast options from a socket to anjhb2011-12-292-3/+39
| | | | | | | | | | asychronous task. This avoids tearing down multicast state including sending IGMP leave messages and reprogramming MAC filters while holding the per-protocol global pcbinfo lock that is used in the receive path of packet processing. Reviewed by: rwatson MFC after: 1 month
* Use queue(3) macros instead of home-rolled versions in several places injhb2011-12-291-2/+1
| | | | | | | | the INET6 code. This includes retiring the 'ndpr_next' and 'pfr_next' macros. Submitted by: pluknet (earlier version) Reviewed by: pluknet
* Don't fallback to a CARP address in BACKUP state.glebius2011-12-291-1/+3
|
* Address issues found by clang. While there, fix also some styletuexen2011-12-2714-295/+239
| | | | | | issues. MFC after: 3 months.
* Use a better log message for master down event.glebius2011-12-221-1/+1
|
* Provide ABI compatibility shim to enable configuring of addressesglebius2011-12-211-1/+17
| | | | | | with ifconfig(8) prior to r228571. Requested by: brooks
* Restore a feature that was present in 5.x and 6.x, and was cleared inglebius2011-12-202-73/+72
| | | | | | | | | | | | | | | | | | | | | | | 7.x, 8.x and 9.x with pf(4) imports: pfsync(4) should suppress CARP preemption, while it is running its bulk update. However, reimplement the feature in more elegant manner, that is partially inspired by newer OpenBSD: - Rename term "suppression" to "demotion", to match with OpenBSD. - Keep a global demotion factor, that can be raised by several conditions, for now these are: - interface goes down - carp(4) has problems with ip_output() or ip6_output() - pfsync performs bulk update - Unlike in OpenBSD the demotion factor isn't a counter, but is actual value added to advskew. The adjustment values for particular error conditions are also configurable, and their defaults are maximum advskew value, so a single failure bumps demotion to maximum. This is for POLA compatibility, and should satisfy most users. - Demotion factor is a writable sysctl, so user can do foot shooting, if he desires to.
* Fix unused parameter warnings.tuexen2011-12-1735-354/+332
| | | | | | While there, fix some whitespace issues. MFC after: 3 months.
* Since size of struct in_aliasreq has just been changed in r228571,glebius2011-12-161-6/+0
| | | | | and thus ifconfig(8) needs recompile, it is a good chance to make parameter checks on SIOCAIFADDR arguments more strict.
* A major overhaul of the CARP implementation. The ip_carp.c was startedglebius2011-12-166-1449/+1067
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]
* Belatedly catch up with r151555. in_scrubprefix() also needs this fix. Weglebius2011-12-131-8/+16
| | | | | should compare not only addresses, but their masks, too, when searching for matching prefix.
* Fix a bug reported by Irene Ruengeler which resulted in not sendingtuexen2011-12-102-0/+3
| | | | | | | out HEARTBEATs when requested by the user. The HEARTBEATs were only queued, but not actually sent out. MFC after: 2 months.
* Fix a very special case when SIOCAIFADDR supplies mask of 0.0.0.0,glebius2011-12-061-5/+6
| | | | don't overwrite the mask with autoguessing based on classes.
OpenPOWER on IntegriCloud