summaryrefslogtreecommitdiff
path: root/sys/netinet
AgeCommit message (Collapse)Author
2014-10-20use sha512 instead of md5 for tcp isn. ok deraadtTed Unangst
2014-10-14Don't check for an empty list of interfaces. This is never true even ifMartin Pieuchot
you don't have a physical interface on your machine, so why rawip should be more clever^Wparanoid than the others? ok henning@, mikeb@
2014-10-14Use rtfree() instead of RTFREE(), NULLify some free'd route pointers andMartin Pieuchot
kill the macro. ok mikeb@, henning@
2014-10-08Remove #ifdef SO_OOBINLINE, it is always defined.Alexander Bluhm
OK henning@
2014-10-08Check if the outgoing route is associated to a broadcast address insteadMartin Pieuchot
of doing a lookup on all the addresses of the outgoing interface. ok henning@
2014-10-07Do not protect the SIOCSIFADDR call by splnet(). Drivers alreadyMartin Pieuchot
raise it inside their ioctl handler (except for carp(4), what else?). In general, global structures manipulated in the softnet codepath only require a splsoftnet() protection when they are modified in process (ioctl) context. Also put some IPL_SOFNET asserts in functions accessing global structures. Previous version diff ok mikeb@, with inputs from and ok bluhm@
2014-10-02There is no point in trying to purge the default host route forMartin Pieuchot
loopback interfaces because we no longer add it. ok claudio@
2014-10-01Fix loopback related breakage introduced by the conversion of in_ouraddr()Martin Pieuchot
to use the routing table. Do not create a host route for loopback addresses apart from the local ones otherwise these addresses are not considered as part of the machine. Reported by deraadt@ and Heiko Zimmermann on bugs@.
2014-09-30add back the sys/sysctl.h include removed in rev 1.60Jonathan Gray
fixes the kernel build when PIM is defined
2014-09-30Do not use the global list of IPv4 addresses in icmp_reflect()...Martin Pieuchot
...but the routing table! Note that this lookup is redundant with the one done in in_ouraddr() and we should be able to save this information instead of redoing a lookup if we need to send an error message. ok kspillner@, bluhm@, claudio@
2014-09-30Use the routing table instead of the RB-tree for address lookups inMartin Pieuchot
in_ouraddr(). The lookup done in the forwarding case will hopefully be merged with this one in the future. ok kspillner@, bluhm@, claudio@
2014-09-28Remove a limitation that ignored IPv6 link-local addresses on carp(4).Reyk Floeter
This workaround was needed when the interface link-local address was still enabled by default to prevent immediate state transition on interfaces without any configured addresses. This is not needed anymore and removing the limitation allows to use carp(4) with addresses like fe80::2%carp0. discussed with some ok mpi@ pelikan@
2014-09-27Kill rtalloc() and update rtalloc1() and rtalloc_mpath() to no longerMartin Pieuchot
rely on "struct route" that should die. ok claudio@
2014-09-14remove uneeded proc.h includesJonathan Gray
ok mpi@ kspillner@
2014-09-08remove uneeded route.h includesJonathan Gray
ok miod@ mpi@
2014-09-03When a route to prefix (connected route) is added, if its associatedMartin Pieuchot
broadcast address is non null, add a broadcast entry flagged with RTF_BROADCAST. Re-use the existing logic to switch a route to prefix from an ifa to another to also move this broadcast entry. Prior to this change broadcast entries were simple clonned ARP entries, that would be deleted once their timer expired since they would always be incomplete. With this change they are now persistant and identifiable with a new flag This version of the diff prevent a corruption reported by millert@ ok mikeb@, florian@
2014-09-03Make sure broadcast entries won't be freed by the arp timer so we canMartin Pieuchot
use them for address lookups. While here do let in_arpinput() overwrite local or broadcast entries. ok mikeb@, florian@
2014-08-27Nuke net.inet6.icmp6.rediraccept and allow redirects on interfacesFlorian Obser
with autoconf enabled. If one is doing SLAAC one does already trust link local icmp6 so the policy for icmp6 redirects should be the same. pointed out by & OK bluhm@; OK henning@
2014-08-26Revert the addition of broadcast addresses, it apparently also corruptsMartin Pieuchot
the tree. Found by millert@.
2014-08-23Move splnet() in in_ifinit() to protect less code that does notAlexander Bluhm
need it. OK mpi@
2014-08-19When a local route entry is added for an ifa having a broadcast address,Martin Pieuchot
also adds a broadcast entry flagged with RTF_BROADCAST. Prior to this change broadcast entries were simple clonned ARP entries, that would be deleted once their timer expired since they would always be incomplete. With this change they are now persistant and identifiable with a new flag. Committing early to be able to deal with any potential fallout before we start relying on this. ok florian@, mikeb@, henning@
2014-08-14No need for raw_cb.hMartin Pieuchot
2014-08-14Kill MRT_{ADD,DEL}_BW_UPCALL interfaces and the bandwidth monitoringMartin Pieuchot
code that comes with them. ok mikeb@, henning@
2014-08-11Use the RTF_LOCAL flag instead of abusing the RTF_LLINFO flag whenMartin Pieuchot
adding local route entries. This hack made sense when we didn't have the RTF_LOCAL flag, but since some months it is set on every local route.
2014-08-11Convert ARP llinfo allocation to pool(9).Martin Pieuchot
ok henning@, dlg@
2014-08-10Fix the length check for reinjected ICMP packets: sizeof(struct icmp) isLawrence Teo
28 but an ICMP packet can be as small as 8 bytes (e.g. an ICMP echo request packet with no payload), so check against ICMP_MINLEN instead. Prior to this fix, divert(4) would erroneously discard valid ICMP packets that are shorter than 20 bytes. ICMPv6 is not affected, so this change applies to ICMP over IPv4 only. ok florian@ henning@
2014-08-10Rename p_hdrlen to min_hdrlen to better reflect its purpose.Lawrence Teo
No object file change ok florian@ henning@
2014-07-22Fewer <netinet/in_systm.h> !Martin Pieuchot
2014-07-14In the next step, stop accepting the nibble-swapped protocol for 5.6.Theo de Raadt
This completes the transition. A cvs log and diff will tell the story of why we went through this. with david.dahlberg@fkie.fraunhofer.de and claudio
2014-07-13Stop using old n_time, n_long and n_short types in netinet headers.Martin Pieuchot
ok deraadt@, naddy@
2014-07-12Resize the pcb hashtable automatically. The table size will be doubledYASUOKA Masahiko
when the number of the hash entries reaches 75% of the table size. ok dlg henning, 'commit in' claudio
2014-07-12Remove the redundant csum_flag variable and just set the checksum flagLawrence Teo
in the pkthdr directly. ok henning@
2014-07-12Protocol checksums have been recalculated on reinjection for a whileLawrence Teo
now, so there is no need to calculate them before sending them to userspace. ok henning@
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-07-12Tackle the endian.h mess. Make it so that:Philip Guenther
* 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@
2014-07-12Always create a local route for every configured IPv4 address on theMartin Pieuchot
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.
2014-07-12Implement checksum offload for divert(4): simply set the checksum flagLawrence Teo
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@
2014-07-11in_proto_cksum_out: zero the icmp cksum before going on so that we do notHenning Brauer
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
2014-07-11There is a use-after-free somewhere in the code that links the pfAlexander Bluhm
state to the socket pcb. Add an additional assert to narrow down the panics. OK henning@
2014-07-11Remove rfc 4620 Node Information Query support (from the kernel).Sebastian Benoit
ok henning@ stu@, Yay! weerd@
2014-07-10Simplify the way divert(4) sends packets to userspace: Instead ofLawrence Teo
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@
2014-07-09bpf code surgery / shuffling / simplification.Henning Brauer
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
2014-07-08decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hTheo de Raadt
don't need to be married. ok guenther miod beck jsing kettenis
2014-06-30Kill dead code, what does a negative number of addresses on a carp(4)Martin Pieuchot
mean? ok deraadt@
2014-06-26Calling in{6,}_purgeaddr() is not enough to remove an address fromMartin Pieuchot
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@
2014-06-23repair ramdisk buildsTheo de Raadt
2014-06-23Fix compile without IPSEC.YASUOKA Masahiko
Pointed out by Ivan Solonin. ok henning mpi jca
2014-06-16Revert "Always create a local route for every configured IPv4 address",Martin Pieuchot
it introduces a regression with default routes & p2p interfaces. Problem reported by naddy@
2014-06-11Always create a local route for every configured IPv4 address on theMartin Pieuchot
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@
2014-06-04Only use ifa_ifwithaddr() to check if the binding address is on theMartin Pieuchot
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@