summaryrefslogtreecommitdiffstats
path: root/sys/netinet (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Stop using old n_time, n_long and n_short types in netinet headers.mpi2014-07-136-33/+33
| | | | ok deraadt@, naddy@
* Resize the pcb hashtable automatically. The table size will be doubledyasuoka2014-07-124-12/+53
| | | | | | when the number of the hash entries reaches 75% of the table size. ok dlg henning, 'commit in' claudio
* Remove the redundant csum_flag variable and just set the checksum flaglteo2014-07-121-8/+5
| | | | | | in the pkthdr directly. ok henning@
* Protocol checksums have been recalculated on reinjection for a whilelteo2014-07-121-4/+1
| | | | | | | now, so there is no need to calculate them before sending them to userspace. ok henning@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-1211-87/+87
| | | | after discussions with beck deraadt kettenis.
* Tackle the endian.h mess. Make it so that:guenther2014-07-121-2/+10
| | | | | | | | | | | | | | | | | | * you can #include <sys/endian.h> instead of <machine/endian.h>, and ditto <endian.h> (fixes code that pulls in <sys/endian.h> first) * those will always export the symbols that POSIX specified for <endian.h>, including the new {be,le}{16,32,64}toh() set. c.f. http://austingroupbugs.net/view.php?id=162 if __BSD_VISIBLE then you also get the symbols that our <machine/endian.h> currently exports (ntohs, NTOHS, dlg's bemtoh*, etc) * when doing POSIX compiles (not __BSD_VISIBLE), then <netinet/in.h> and <arpa/inet.h> will *stop* exporting the extra symbols like BYTE_ORDER and betoh* ok deraadt@
* Always create a local route for every configured IPv4 address on thempi2014-07-122-5/+12
| | | | | | | | | | | | | | | | machine and restore the original behavior of RTM_ADD and RTM_DELETE by always generating one message per locally configured address. This time, make sure the local route is removed during an address change, since at least pppoe(4) do some funky magics with wildcard addresses that might corrupt the routing tree, as found by naddy@ Also do not add a local route if the specified address is 0.0.0.0, to prevent a tree corruption, as found by guenther@. Putting this in now so that it gets tested, claudio@ agrees. Please contact me if you find any route-related regression caused by this change.
* Implement checksum offload for divert(4): simply set the checksum flaglteo2014-07-121-28/+22
| | | | | | | | | | | | and let the stack take care of the checksums for reinjected outbound packets. Reinjected inbound packets will continue to have their checksums calculated manually but we can now take advantage of in_proto_cksum_out and in6_proto_cksum_out to streamline the way their checksums are done. help from florian@ and henning@, feedback from naddy@ ok florian@ henning@
* in_proto_cksum_out: zero the icmp cksum before going on so that we do nothenning2014-07-111-5/+10
| | | | | | | require the caller to do so. lteo needs that for divert soon, and is in line with tcp/udp and the general approach that the rest of the stack should not need to do anything regarding the cksums but setting the "needs it" flag. ok lteo
* There is a use-after-free somewhere in the code that links the pfbluhm2014-07-112-4/+10
| | | | | | state to the socket pcb. Add an additional assert to narrow down the panics. OK henning@
* Remove rfc 4620 Node Information Query support (from the kernel).benno2014-07-111-3/+3
| | | | ok henning@ stu@, Yay! weerd@
* Simplify the way divert(4) sends packets to userspace: Instead oflteo2014-07-102-13/+5
| | | | | | | | | unnecessarily allocating an mbuf tag to store the divert port, just pass the divert port directly to divert_packet() or divert6_packet() as an argument. includes a style fix pointed out by bluhm@ ok bluhm@ henning@ reyk@
* bpf code surgery / shuffling / simplification.henning2014-07-095-11/+11
| | | | | | | | | | | | | | | the various bpf_mtap_* are very similiar, they differ in what (and to some extent how) they prepend something, and what copy function they pass to bpf_catchpacket. use an internal _bpf_mtap as "backend" for bpf_mtap and friends. extend bpf_mtap_hdr so that it covers all common cases: if dlen is 0, nothing gets prepended. copy function can be given, if NULL the default bpf_mcopy is used. adjust the existing bpf_mtap_hdr users to pass a NULL ptr for the copy fn. re-implement bpf_mtap_af as simple wrapper for bpf_mtap_hdr. re-implement bpf_mtap_ether using bpf_map_hdr re-implement bpf_mtap_pflog as trivial bpf_mtap_hdr wrapper ok bluhm benno
* decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hderaadt2014-07-082-3/+4
| | | | | don't need to be married. ok guenther miod beck jsing kettenis
* Kill dead code, what does a negative number of addresses on a carp(4)mpi2014-06-301-19/+1
| | | | | | mean? ok deraadt@
* Calling in{6,}_purgeaddr() is not enough to remove an address frommpi2014-06-261-1/+2
| | | | | | | | | | | | an interface. Two other operations are performed when issuing a SIOCDIFADDR{_IN6,} ioctl: call the address hook and the per-driver ioctl function. Since carp(4) relies on an address hook to recalculate its hash, make sure to call this hook when IFXF_NOINET6 is set or when the rdomain is changed. ok henning@, mikeb@
* repair ramdisk buildsderaadt2014-06-231-2/+2
|
* Fix compile without IPSEC.yasuoka2014-06-231-2/+2
| | | | | Pointed out by Ivan Solonin. ok henning mpi jca
* Revert "Always create a local route for every configured IPv4 address",mpi2014-06-162-9/+4
| | | | | | it introduces a regression with default routes & p2p interfaces. Problem reported by naddy@
* Always create a local route for every configured IPv4 address on thempi2014-06-112-4/+9
| | | | | | | machine and restore the original behavior of RTM_ADD and RTM_DELETE by always generating one message per locally configured address. Tested by krw@, jca@ and florian@
* Only use ifa_ifwithaddr() to check if the binding address is on thempi2014-06-041-7/+15
| | | | | | | | | | | | | | | | | | | | | system. Yes, this is ugly for the moment because OpenBSD prevents you from binding a tcp socket to broadcast address and checking for a broadcast address is... funny! If you've ever wondered why would lead people to write: ina.s_addr != ia->ia_addr.sin_addr.s_addr instead of: ina.s_addr == ia->ia_broadaddr.sin_addr.s_addr Well this is because all the IPv4 addresses belonging to your lo(4) interfaces match the second idiom. Hopefully we'll get rid of this hack soon. ok jca@, mikeb@
* Stop using a global variable to do address lookups.mpi2014-06-041-6/+19
| | | | ok blambert@, mikeb@
* Simply use ifa_ifwithaddr() to check if the binding address is on thempi2014-06-021-4/+4
| | | | | | | system. This function checks for unicast and broadcast addresses, so there is no need to do two lookups instead of one. Inputs & ok jca@, ok mikeb@
* correctly match size and buffer. from enh at googlempi2014-05-201-3/+3
|
* Includes a router altert option (RAO) in IGMP packets. Without thismpi2014-05-122-6/+30
| | | | | | | option, required by the RFC2236, some L3 switches do not examine the packets. Based on FreeBSD's r14622 via Florian Riehm on tech@. ok bluhm@, jca@
* Fix a few bad indentsclaudio2014-05-101-4/+4
|
* Remove the last hacks concerning the global list of IPv4 addresses in thempi2014-05-072-26/+5
| | | | | | | | | | source address selection logic. These hacks were only relevant for the NFS diskless boot code in order to pick the local broadcast address of the only configured interface. So, be explicit and set this address directly. Tested by florian@, ok henning@, beck@, chrisz@
* Kill the {nd6_,}useloopback buttons, using the loopback interface formpi2014-05-072-25/+6
| | | | | | local traffic is not optional. ok mikeb@, stsp@, jca@
* Remove some m->m_pkthdr.rcvif dereference to help for upcomingmpi2014-05-071-7/+9
| | | | | | receiving pointer -> index conversion. No functional change. ok chrisz@, jca@, mikeb@, lteo@
* Use a custom ifa_rtrequest function for point-to-point interfacesmpi2014-05-051-1/+7
| | | | | | | | | | instead of relying on hacks in nd6_rtrequest() to add a route to loopback for each address configured on such interfaces. While here document that abusing lo0 for local traffic is not safe for interfaces in a non-default rdomain. Tested by claudio@, jca@ and sthen@, ok sthen@
* Remove carp_seroute() it no longer does anything useful but mess withmpi2014-04-301-129/+1
| | | | | | | | | | | | | | | | | | | | | | your IPv4 routes. mcbride@ says that this function has been introduced in order to be able to reach the MASTER node from a BACKUP node using the CARP address. The reasons are: 1) For troubleshooting, so I can ping or otherwise monitor the MASTER host. 2) In some cases it's undesirable (or even not possible) to run services on other IP addresses. For example, services that only allow you to configure 1 listening IP, or services where you wish to avoid users connecting to anything but the MASTER server. Sadly this function becames a horrible hack. So if somebody thinks the reasons explained before justify such logic, feel free to submit a correct diff. ok bluhm@, henning@, mikeb@
* Kill in_localaddr(), one less usage of the global list of IPv4 addresses.mpi2014-04-253-30/+10
| | | | | | | | | | This function is used only once in our tree to optimize the size of the MSS if the forward address correspond to a host on one of our subnets, but only if ip.mutdisc is disable, which is not the default! While here get rid of the "#ifdef RTV_MTU", it is here. ok henning@, mikeb@, bluhm@
* No need for vargs here.florian2014-04-232-16/+8
| | | | | | | While there move declaration of divert{,6}_output() to .c as it's a private function. Also switch first two args to make it more like similar functions (both suggested by mpi@). Input/OK mpi@, OK lteo@
* Don't use varargs for udp_output() and sync the argument order withmpi2014-04-232-19/+11
| | | | | | udp6_output(). ok henning@, reyk@, jca@
* ip_output() using varargs always struck me as bizarre, esp since it's onlyhenning2014-04-2114-39/+32
| | | | | | ever used to pass on uint32 (for ipsec). stop that madness and just pass the uint32, 0 in all cases but the two that pass the ipsec flowinfo. ok deraadt reyk guenther
* we'll do fine without casting NULL to struct foo * / void *henning2014-04-217-29/+22
| | | | ok gcc & md5 (alas, no binary change)
* remove a define in an #ifdef notyet - "not yet" for 19 years gotta behenning2014-04-211-7/+1
| | | | | enough. remove a define in an #ifdef notdef /* obsolete */ - 14 years are enough
* annotate all #endifs to make clear what #if(def) they endhenning2014-04-211-9/+8
|
* cosmetic changes regarding #ifdef to make things more obvious, ok reykhenning2014-04-211-4/+4
|
* ether_output: instead of assembling the ethernet header and then callinghenning2014-04-202-9/+8
| | | | | | | carp_rewrite_lladdr to overwrite the src lladdr, get the intended src lladdr before assembling the ethernet header. carp_rewrite_lladdr -> carp_get_srclladdr ok reyk claudio
* move in_cksum_phdr from in.h (under #ifdef _KERNEL, at least) to ip_output.chenning2014-04-202-33/+27
| | | | | nothing except in_proto_cksum_out() uses it any more, and that's a good thing. was on tech for 3 months, discussed with many
* nuke in_cksum_addword()henning2014-04-201-17/+1
| | | | | | | | | | don't we all love functions implemented in header files? was under #ifdef _KERNEL at least. incremental checksum updates don't really make sense any more, this is incredibly hard to get right, and doesn't fit the way our kernel deals with the checksums these days. consequently, nothing uses in_cksum_addword any more. was on tech for 3 months, tested by & discussed with many.
* tcp_respond: let the stack worry about the cksum instead of doing ithenning2014-04-181-16/+3
| | | | manually, ok naddy (in january)
* Invert the signature logic of in{,6}_selectsrc, make them return thejca2014-04-183-34/+28
| | | | | | | | error code and pass the resulting source address back to the caller through a pointer, as suggested by chrisz. This gives us more readable code, and eases the deletion of useless checks in the callers' error path. Add a bunch of "0 -> NULL" conversions, while here. ok chrisz@ mpi@
* Merge in_fixaddr() into in_selectsrc() in order to prepare formpi2014-04-163-76/+74
| | | | | | | IP_SENDSRCADDR support. This reduces the differences with the IPv6 version and kill some comments that are no longer true. ok jca@, chrisz@, mikeb@
* "struct pkthdr" holds a routing table ID, not a routing domain one.mpi2014-04-1418-95/+96
| | | | | | | | | | | | | | Avoid the confusion by using an appropriate name for the variable. Note that since routing domain IDs are a subset of the set of routing table IDs, the following idiom is correct: rtableid = rdomain But to get the routing domain ID corresponding to a given routing table ID, you must call rtable_l2(9). claudio@ likes it, ok mikeb@
* notify userland when arp entry is removed; ok mpimikeb2014-04-101-6/+2
|
* Retire rtinit() an use rt_ifa_add(9) and rt_ifa_del(9) to managempi2014-04-101-14/+17
| | | | | | | | | | connected routes to prefixes/hosts. Since the introduction of rt_ifa_addloop(9) and rt_ifa_delloop(9), rtinit() was just a wrapper, so use the underlying functions directly and document them. Inputs from and ok mikeb@, manpage tweaks from jmc@
* In udp_output() also use the correct source address in case of an unbound socket.chrisz2014-04-071-1/+3
| | | | OK claudio@
* Retire kernel support for SO_DONTROUTE, this time without breakingmpi2014-04-077-75/+24
| | | | | | | | | | | localhost connections. The plan is to always use the routing table for addresses and routes resolutions, so there is no future for an option that wants to bypass it. This option has never been implemented for IPv6 anyway, so let's just remove the IPv4 bits that you weren't aware of. Tested a least by lteo@, guenther@ and chrisz@, ok mikeb@, benno@