summaryrefslogtreecommitdiff
path: root/sys/netinet
AgeCommit message (Collapse)Author
2008-03-15revert - I'm a dumbfuck who doesn't know his own APIDamien Miller
2008-03-15off by one at end of arrayDamien Miller
2008-03-15Because the ip_id code initialisation is a specific case of shufflingDamien Miller
a set of incrementing integers (and not an arbitrary set of values) it is possible to populate the array as we shuffle it in a single forward pass. Clever optimisation from didickman AT gmail.com; ok deraadt@ mcbride@
2008-03-02because arc4random_uniform is being used, the modulo bias is taken care ofTheo de Raadt
2008-03-02Add a arc4random_uniform() that returns a uniformly distributed numberDamien Miller
in the range 0 <= x < upper_bound Please use this new API instead of "arc4random() % upper_bound", as it avoids the "modulo bias" that favours small results when upper_bound is not a power of two. feedback deraadt@ mcbride@; ok deraadt@
2008-02-29replacement algorithm. initialize a 64K-short buffer using DurstenfeldTheo de Raadt
shuffle. Upon allocation, swap-permute the new value to a random slot in the 0..32K-1 th entry of the buffer as we move forward, ensuring randomness but also satisfying the non-repeating property we need. Also avoid the value of 0, since IP ID's of 0 are special. Inspired by Dillon's implementation. We believe this is easier to read though, initializes with less bias, handles the ID of 0 properly, and wins speed tests. Thanks a lot to mcbride and djm for doing a bunch of statistical and speed analysis, and comments from nordin ok mcbride djm
2008-02-20Add my copyright.Marco Pfatschbacher
OK mcbride@, mickey@
2008-02-20remove old unused TCP isn code; ok henning, dhartmei, mcbrideMarkus Friedl
2008-02-20when creating a response, use the correct TCP header instead ofMarkus Friedl
relying on the mbuf chain layout; with claudio@ and krw@; ok henning@
2008-02-11The TCP server has to recalculate the client's window size takenAlexander Bluhm
from the first ACK packet. Otherwise the server would use the unscaled window size for the fist data it is sending. ok markus@ dhartmei@
2008-02-05Move carp load balancing (ARP/IP) to a simpler configuration scheme.Marco Pfatschbacher
Instead of using the same IP on multiple interfaces, carp has to be configured with the new "carpnodes" and "balancing" options. # ifconfig carp0 carpnodes 1:0,2:100,3:100 balancing ip carpdev sis0 192.168.5.50 Please note, that this is a flag day for anyone using carp balancing. You'll need to adjust your configuration accordingly. Addititionally this diff adds IPv6 NDP balancing support. Tested and OK mcbride@, reyk@. Manpage help by jmc@.
2008-01-02return with ENOTTY instead of EINVAL for unknown ioctl requests.Brad Smith
ok claudio@ krw@ dlg@
2007-12-30A struct rt_addrinfo is needed for rt_missmsg() so we can use rtrequest1()Claudio Jeker
directly instead of takeing the detour via rtrequest(). OK henning@ markus@
2007-12-14add sysctl entry points into various network layers, in particular toTheo de Raadt
provide netstat(1) with data it needs; ok claudio reyk
2007-12-13Add missing license. This file is 4.4BSD-derived with WIDE changes.Todd C. Miller
OK deraadt@
2007-12-13implement sysctls to report IP, TCP, UDP, and ICMP statistics andReyk Floeter
change netstat to use them instead of accessing kvm for it. more protocols will be added later. discussed with deraadt@ claudio@ gilles@ ok deraadt@
2007-11-27TCP_COMPAT_42 was last used in 1997. Kill it.Theo de Raadt
ok millert
2007-11-27typos; ok jmc@Martynas Venckus
sys/dev/pci/pciide.c from naddy@
2007-11-27Make carp(4) behave more like a ethernet interface by initalizing theClaudio Jeker
IPv4 interface address similar to arp_ifinit(). The main difference is that we do not send out a gracious arp as the carp(4) is not ready to send at that moment. This will make backup interface show up like the master ones. OK mpf@ earlier version OK henning@ mcbride@
2007-11-26MALLOC -> malloc and M_ZERO changeCharles Longeau
ok mpf@ henning@
2007-11-26typos; ok jmc@Martynas Venckus
sys/netinet/in_pcb.c and sys/net/bridgestp.c ok henning@ sys/dev/pci/bktr/* ok jakemsr@
2007-11-24some spelling fixes from Martynas VenckusJason McIntyre
2007-11-22pass the carp ifp to rt_missmsg() when generating the RTM_ADD messagesHenning Brauer
so the resulting messages have ifindex set and the routing daemons can correctly indentify that route as connected. ok mcbride
2007-11-22Factor out the virtual host portion of carp into a separate structMarco Pfatschbacher
that is kept in a list per carp interface. This is the huge first step necessary to make carp load balancing nice and easy. One carp interface can now contain up to 32 virtual host instances. This doesn't do anything useful yet, but here is how an ifconfig for multiple entries now looks like: # ifconfig carp2 carpnodes 5:0,6:100 192.168.5.88 carp2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 lladdr 00:00:5e:00:01:05 carp: carpdev sis0 advbase 1 state MASTER vhid 5 advskew 0 state BACKUP vhid 6 advskew 100 groups: carp inet 192.168.5.88 netmask 0xffffff00 broadcast 192.168.5.255 OK mcbride@
2007-11-19Remove the #define ENCDEBUG that slipped through somehow.Marco Pfatschbacher
OK hshoexer@
2007-11-16in the strange/unnatural/ridiculous situation where a non-blockingTheo de Raadt
connect() which has completed and failed.. if connect() is called again.. return the so_error instead of EINVAL; from Alexey Vatchenko matches what other systems do now ok millert henning
2007-11-16use arc4random_bytes() instead of multiple arc4random() calls;Damien Miller
ok deraadt@ dlg@ henric@ mcbride@
2007-11-06Do not panic in arpintr() if IF_DEQUEUE returns NULL, this is perfectly legalMiod Vallat
and can happen on slow mp systems under a lot of network load; ok kettenis@
2007-10-29MALLOC/FREE -> malloc/freeCharles Longeau
ok krw@
2007-10-27Replace the replay protection counter with a cookie.Marco Pfatschbacher
It is unlikely we will ever get a working replay protection, so better keep it simple and robust. The cookie allows us to detect our own advertisements, thus it is now easy to deal with network loops and non-simplex interfaces. Zero feedback by the people who wanted this fixed. OK henning@, markus@
2007-10-17Convert MALLOC/FREE to malloc/free.Hans-Joerg Hoexer
ok gilles@
2007-10-09MALLOC+bzero -> malloc+M_ZERO. Don't forget FREE->free this time.Kenneth R Westerback
As with many of the last commits, looked at by chl@ in an earlier version.
2007-10-09MALLOC+bzero -> malloc+M_ZERO. Don't forget FREE->free this time.Kenneth R Westerback
'Fixes' two cases where the zeroing did not cover all the memory allocated. As with many of the last commits, looked at by chl@ in an earlier version.
2007-10-06Oops. Forgot to do FREE -> free when I did MALLOC -> malloc.Kenneth R Westerback
2007-10-03MALLOC+bzero -> malloc+M_ZERO.Kenneth R Westerback
In ip_esp.c all allocated memory is now zero'd in the "malloc(sizeof(*tc) + alen ..." case. The +alen memory was not initialized by the bzero() call. Noticed by chl@. "Looks good" art@ "seems ok" chl@
2007-10-01Last of the really easy bzero() -> M_ZERO. Use 'p = malloc(sizeof(*p) ...'Kenneth R Westerback
where obvious.
2007-09-24Fix carp(4) after the switch to dynamic imo_membership allocation.Claudio Jeker
The multicast code is still a mess but will no longer crash the box. With input from pascoe@ who hit the same bug. OK markus@, henning@, mpf@ (on a previous version)
2007-09-18arc4random_bytes() is the preferred interface for generating nonces;Damien Miller
"looks ok" markus@
2007-09-18allow 4095 instead of 20 multicast group memberships per socket (you needMarkus Friedl
one entry for each multicast group and interface combination). this allows you to run OSPF with more than 10 interfaces. adapted from freebsd; ok claudio, henning, mpf
2007-09-18ARP balancing has been changed to use the source MAC addressMarco Pfatschbacher
quite a while ago. Manpage and comment update by Matthew Dempsky. OK jmc@
2007-09-17remove backpointer from ifa to ifp if an address gets delete; fixesMarkus Friedl
panics in ip_freemoptions(); ok claudio, henning, mpf
2007-09-10Remove the ipq locking, it isn't strictly needed right nowThordur I. Bjornsson
and is actually wrong in some cases, since we can enter functions without taking the lock because the return value of ipq_lock() isn't checked properly. However, this needs to be revisited when we start calling ip_drain() from the pool code when we are running out of memory, but this isn't done currently. OK art@, henning@
2007-09-03Make use of the carp preempt counter to signal number of transitions ofJoel Knight
any carp group to master status. ok dhartmei@
2007-09-01since theHenning Brauer
MGET* macros were changed to function calls, there wasn't any need for the pool declarations and the inclusion of pool.h From: tbert <bret.lambert@gmail.com>
2007-07-20Remove inm_ifp from struct in_multi -- caching struct ifnet is dangerousClaudio Jeker
because interfaces may disappear without notice causing use after free bugs. Instead use the inm_ia->ia_ifp as a hint, struct in_ifaddr correctly tracks removals of interfaces and invalidates ia_ifp in such cases. looks good henning@ markus@
2007-07-04Fix a use after free crash in in_delmulti(). If a interface is detachedClaudio Jeker
before it is removed from the multicast group in_delmulti() will try to access the no longer available ifp. We invalidate the ifa_ifp back pointer in the ifa in if_detach() now and use the ifa_ifp in in_delmulti() instead of the internal inm_ifp. By doing it this way we know if the interface was removed. This fixes a kernel panic triggered by ospfd and gif(4) tunnels. looks good henning@ reyk@
2007-06-25merge tcp_set_iss() and tcp_set_tsm(); ok mcbride, djm (on earlier version)Markus Friedl
2007-06-23use a masked destination network instead of the interface ip for theReyk Floeter
destination of the route belonging to the carp interface. ok mpf@ claudio@
2007-06-15Drop the current random timestamps and the current ISN generationMarkus Friedl
code and replace both with a RFC1948 based method, so TCP clients now have monotonic ISN/timestamps. The server side uses completely random ISN/timestamps and does time-wait recycling (on port reuse). ok djm@, mcbride@; thanks to lots of testers
2007-06-14preserve the possible route label if the route belongs to the carpReyk Floeter
interface (ip-less parent). tested by claudio and me ok claudio@