summaryrefslogtreecommitdiff
path: root/sys/netinet
AgeCommit message (Collapse)Author
2013-10-13Import vxlan(4), the virtual extensible local area network tunnelReyk Floeter
interface. VXLAN is a UDP-based tunnelling protocol for overlaying virtualized layer 2 networks over layer 3 networks. The implementation is based on draft-mahalingam-dutt-dcops-vxlan-04 and has been tested with other implementations in the wild. put it in deraadt@
2013-10-09Introduce in_ifdetach() a function to remove all the IPv4 addressesMartin Pieuchot
of an interface, named after its IPv6 equivalent. Make use of it instead of removing addresses by hand when detaching or destroying an interface. As a bonus, multicast records linked to the just divorced^Wdetached interface are no longer leaked. No objection from the gang, ok mikeb@
2013-09-26Move the logic for deleting an IPv4 address to its own function.Martin Pieuchot
No functional change. ok henning@, mikeb@
2013-09-06In one core dump the pointers to socket, inpcb, tcpcb on the stackAlexander Bluhm
of tcp_input() and tcp_output() were very inconsistent. Especially the so->so_pcb is NULL which can only happen after the inp has been detached. The whole issue looks similar to the old panic: pool_do_get(inpcbpl): free list modified. http://marc.info/?l=openbsd-bugs&m=132630237316970&w=2 To get more information, add some asserts that guarantee the consistency of the socket, inpcb, tcpcb linking. They should trigger when an inp is taken from the pcb hashes after it has been freed. OK henning@
2013-09-06Make use of IFP_TO_IA() instead of rolling our own copy.Martin Pieuchot
ok bluhm@, henning@
2013-09-03Use satosin() rather than the local SIN macro, no functional change.Martin Pieuchot
ok mikeb@
2013-08-29Iterate over the interface's address list instead of the global list.Martin Pieuchot
ok bluhm@, mikeb@
2013-08-28Replace hand-crafted for loop over in_ifaddr with FOREACH macro.Alexander Bluhm
OK mpi@
2013-08-28If have an interface pointer, look for an address on its list ratherMartin Pieuchot
than iterating on the global list. ok bluhm@
2013-08-28Remove unused argument from *rtrequest()Martin Pieuchot
ok krw@, mikeb@
2013-08-21Stop using static variables in ICMP. While this is perfectly ok forMartin Pieuchot
the moment because there might be at most one caller at a time, it wont be so as soon as this part of the network stack is run in parallel. While here also reduce the difference with the icmp6 code adding a redirect route. ok mikeb@
2013-08-21When checking for classful broadcast addresses, iterate over the listMartin Pieuchot
from the interface on which the packet was received on instead of filtering the global list. ok bluhm@, henning@
2013-08-20tedu netnatm and ueagle(4).Martin Pieuchot
ok mikeb@, sthen@, tedu@ (implied), doc bits ok jmc@
2013-08-19In case something bad happened when configuring an IPv4 address, makeMartin Pieuchot
sure we add its descriptor back to the tree and interface list to keep the various global structures consistent. ok mikeb@, bluhm@
2013-08-13When net.inet.ip.sourceroute is enable, store the source routeMartin Pieuchot
of incoming IPv4 packets with the SSRR or LSRR header option in a m_tag rather than in a single static entry. Use a new m_tag type, PACKET_TAG_SRCROUTE, for this and bump PACKET_TAG_MAXSIZE accordingly. Adapted from FreeBSD r135274 with inputs from bluhm@. ok bluhm@, mikeb@
2013-08-12Add the TCP socket option TCP_NOPUSH to delay sending the stream.Alexander Bluhm
This is useful to aggregate data in the kernel from multiple sources like writes and socket splicing. It avoids sending small packets. From FreeBSD via David Hill; OK mikeb@ henning@
2013-08-12In the common IPv4 and IPv6 file ip_carp.c an #ifdef INET6 wasAlexander Bluhm
missing. Especially the IN6_IS_ADDR_LINKLOCAL() macro should not be necessary in IPv4 only code. No binary change. OK henning@ claudio@
2013-08-09Constify the default null sockaddr_dl, no functional change.Martin Pieuchot
ok mikeb@
2013-08-08Constify the table of common MTUs and use nitems(), no functional change.Martin Pieuchot
2013-08-08Change MTU discovery functions to not abuse the global icmpsrc variableMartin Pieuchot
to pass the destination address of the route to clone. ok markus@, mikeb@
2013-08-08Insert new IPv4 addresses in only one place, no functional change.Martin Pieuchot
ok mikeb@, henning@
2013-08-08Make use of IFP_TO_IA() instead of rolling our own copy, no functionalMartin Pieuchot
change. ok mikeb@, henning@
2013-08-06In tcp_ctloutput() tp was assigned at two different places for IPv4Alexander Bluhm
and IPv6. The variable tp is not accessed between these two assingments. intotcpcb() is a define without side effects. So use the same code for IPv4 and IPv6. OK claudio@ mpi@
2013-08-03unbreak PMTU-discovery for AES-GCM; ok mikeb@Markus Friedl
2013-08-01Do not use a static variable to perform a lookup. While thisMartin Pieuchot
is perfectly ok for the moment because there might be at most one caller at a time, it wont be so as soon as this part of the network stack is run in parallel. ok henning@, mikeb@
2013-07-31Move bridge_broadcast and subsequently all IPsec SPD lookup code outMike Belopuhov
of the IPL_NET. pf_test should be no longer called under IPL_NET as well. The problem became evident after the related issue was brought up by David Hill <dhill at mindcry ! org>. With input from and OK mpi. Tested by David and me.
2013-07-04format string fixes: size_t and uint16_tStefan Fritsch
ok bluhm@
2013-07-04These functions are only used in debug code, so put them underMartin Pieuchot
ifdef ENCDEBUG to make sure we don't use them elsewhere.
2013-07-04Rewrite the function used to determine if we do proxy ARP for one ofMartin Pieuchot
our addresses to reuse arplookup() and do only one list iteration. Looks ok to claudio@, ok mikeb@
2013-07-01The reverse parameter of in_pcblookup_listen() is a boolean and notAlexander Bluhm
a flag. Rename the variable inpl_flags in tcp_input() to inpl_reverse like in udp_input(). No binary change. OK mikeb@
2013-06-26put the cksum diff back, of course with the bug fixed where we couldHenning Brauer
under some circumstances repair broken checksums on the way. ok ryan naddy mikeb . redo most of the protocol (tcp/udp/...) checksum handling -assume we have hardware checksum offloading. stop mucking with the checksum in most of the stack -stop checksum mucking in pf, just set a "needs checksumming" flag if needed -in all output pathes, very late, if we figure out the outbound interface doesn't have hw cksum offloading, do the cksum in software. this especially makes the bridge path behave like a regular output path -little special casing for bridge still required until the broadcast path loses its disgusting shortcut hacks, but at least it's in one place now and not all over the stack in6_proto_cksum_out mostly written by krw@ started at k2k11 in iceland more than 1.5 years ago - yes it took that long, this stuff is everything but easy. this happens to fix the infamous pf rdr bug that made us turn off proto cksum offloading on almost all interface drivers.
2013-06-23Revert r1.78 for now, it breaks ipv4 on carp. As found the hard way byStuart Henderson
Jeff Ross and later by myself, both on remote systems..
2013-06-20Always make sure that the temporary TCP protocol control blockMike Belopuhov
structure is zeroed out before use. From David Hill <dhill at mindcry ! org>; ok blambert claudio henning
2013-06-20Revert previous and unbreak asr, the new include should be protected.Martin Pieuchot
Reported by naddy@
2013-06-20Allocate the various hook head descriptors as part of the ifnetMartin Pieuchot
structure rather than doing various M_WAITOK allocations during the *attach() functions, we always rely on them anyway. ok mikeb@, uebayasi@
2013-06-18Use TAILQ_FOREACH() instead of handrolling our own version and stopMartin Pieuchot
iterating once we found a matching address. ok mpf@, yasuoka@, henning@
2013-06-17Always add/remove IPv4 addresses consistently from the global list and tree.Martin Pieuchot
ok bluhm@, mikeb@
2013-06-17In icmp_do_exthdr(), calculate the ICMP extension header checksums withLawrence Teo
in4_cksum() instead of in_cksum(). This gets rid of the clunky m_data/m_len dance, which was described as "disgusting" in the original comments. :) Tested on a small MPLS test network (since icmp_do_exthdr() is currently only used by MPLS code, specifically mpls_do_error()). ok bluhm henning mikeb
2013-06-13Move the local delivery code from ipv4_input() into its own function andMartin Pieuchot
unify some return statements while here. ok bluhm@, henning@
2013-06-11Replace all ovbcopy with memmove; swap the src and dst arguments tooTheo de Raadt
ok otto
2013-06-09Increment udpstat.udps_nosec and tcpstat.tcps_rcvnosec in case packet isYASUOKA Masahiko
dropped by IPsec security policy. input from and ok mikeb
2013-06-05If an ICMP packet gets diverted to a raw IP socket, if must not beAlexander Bluhm
consumed by icmp_input(). As an exception, control packets that belong to a connection to a local socket must go to pr_ctlinput(). Add a switch over the ICMP type to handle that. OK markus@ henning@
2013-06-05Calculate ICMP checksums with in4_cksum() which lets us get rid of theLawrence Teo
clunky m_data/m_len dance needed by in_cksum(). Tested on amd64, hppa, i386, loongson, macppc, sgi, and sparc64. Thanks to blambert@, bluhm@, and henning@ for help and feedback; abieber@ for testing this diff independently on macppc; krw@ for access to his hppa, sgi, and sparc64 test systems at t2k13; nick@ for helping me figure out Ken's hppa so that I can test this diff. :) ok blambert bluhm henning mikeb
2013-06-03fix typo in commentYASUOKA Masahiko
2013-06-03Link pf states and socket inpcbs together more tightly. The linkingAlexander Bluhm
was only done when a packet traveled up the stack from pf to tcp_input(). Now also link the state and inpcb when the packet is going down from tcp_output() to pf. As a consequence, divert-reply states where the initial SYN does not get an answer, can be handled more correctly. This change is part of a larger diff that has been backed out in 2011. Bring the feature back in small steps to see when bad things start to happen. OK henning deraadt
2013-06-03Merge the duplicate IPv4 and IPv6 checksum checking code in tcp_input()Alexander Bluhm
into one block. OK mpi@
2013-06-02increase heat in the hackathon room by making sure everybody has to recompileHenning Brauer
even more of the kernel fix formatting ugliness, whitespace only, obviously a copy & pasto ok ryan
2013-06-02Exclude the mac address for the HMAC calculation if lladdr is the realYASUOKA Masahiko
one so that we can use the real MAC address for carp(4) like an example following. ifconfig carp0 carpdev REALIF lladdr <real interface's lladdr> ok reyk mcbride
2013-06-01Fix typo backswards -> backwards.Alexander Bluhm
2013-06-01Pass the routing domain to IPv6 pr_ctlinput() like in IPv4.Alexander Bluhm
OK claudio@