summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2014-11-20Yet more #include de-duplication.Kenneth R Westerback
ok deraadt@ tedu@
2014-11-20Rework the handling of interfaces and IPv6 addresses for local delivery.Martin Pieuchot
- Unicast packets sent to any local address will have their interface set to loobpack. - In order to differentiate traffic from interfaces having identical link-local addresses, provide the scoped addresses to pf(4). - Update the icmp6 state lookup logic to match scoped MLL addresses. - Remove a shortcut in ip6_input() that bypasses pf and always look for an RTF_LOCAL route. Packets sent to multicast addresses still retain their original interface due to the fact that local multicast packet delivering does not use if_output. This makes ping6 to link-local addresses work even with pf enabled and "set skip" on loopbacks, reported by Pieter Verberne. Debugged, analysed and tested with mikeb@. ok mikeb@, henning@, sthen@
2014-11-19bulk convert memcpy to memmove. at least one bcopy conversion was wrong,Ted Unangst
so use the safer function. can be converted back to memcpy if necessary, but later and only after more careful inspection.
2014-11-18move arc4random prototype to systm.h. more appropriate for most codeTed Unangst
to include that than rdnvar.h. ok deraadt dlg
2014-11-16remove now unnecessary casts from hash update calls.Ted Unangst
2014-11-16convert to use sha512 for pf iss. ok deraadt dlgTed Unangst
2014-11-16mix the rdomain (rtable?) into the hash for tcp iss generation.David Gwynne
ok phessler@ tedu@
2014-11-11Ask networking stack to recalculate the ICMPv6 checksum in pf_route6Mike Belopuhov
since we might have tweaked the addresses. Problem reported and fix test by Bastien Durel <bastien at geekwu ! org>, thanks! OK henning
2014-11-10Split the logic for the ICMP and ICMP6 case in pf_get_sport(). TheAlexander Bluhm
types ICMP_ECHO and ICMP6_ECHO_REQUEST have their special meaning only if the protocol matches. Put an #ifdef INET6 around ICMP6_ECHO_REQUEST to make the kernel without IPv6 compile. OK henning@
2014-11-10Plug a rtentry leak and change the name of the pool to somethingMartin Pieuchot
understandable. ok chris@
2014-11-06fix mac address selection with unnumbered carpdevsHenning Brauer
IP-traffic over a carp interface with the underlaying carpdev being unnumbered (in the numbered case usually the ifp is the carpdev to begin with) went out with the carpdev's mac address istead of the carp interface's one due to a carp hack in ether_output exchanging the carp ifp for its carpdev ones one. move the source mac selection to before that. fixes unnumbered carp use in environments with strict mac address regimes like some exchange points. issue found by your's truly the hard way. ok mpi dlg
2014-11-06Remove unneeded netinet6/ip6_divert.h include.Lawrence Teo
ok bluhm@ dlg@ florian@ mpi@
2014-11-04Remove "pl" suffix on pool names.Martin Pieuchot
ok dlg@, uebayasi@, mikeb@
2014-11-03Do no change the gateway of local routes for p2p interfaces.Martin Pieuchot
This change was defeating the code in rtrequest1(9) checking for route entries with the same dst/gw when the same IP address was configured on multiple interfaces. As a result, multiple local routes were created for the same address and marked as multipath. But changing their gateway to 127.0.0.1 would make them similar and impossible to remove. This would leaves entries with a stall ifa pointer as soon as the address was removed. Prevent a panic reported by todd@
2014-11-01Rename rtalloc1() into rtalloc(9) and convert its flags to only enableMartin Pieuchot
functionnality instead of a mix of enable/disable. ok bluhm@, jca@
2014-10-28Fix pipex(4) to return multicast packets to the caller so that npppd canYASUOKA Masahiko
handle them. Also use M_NOWAIT for copying a multicast packet.
2014-10-28Initialize the lists of the hash tables and the virtual pipexYASUOKA Masahiko
sesssion for multicast in proper way.
2014-10-28Fix pipex(4) to initialize DF bit in IP header for L2TP message.YASUOKA Masahiko
Without this, the packets larger than the minimum MTU on the routes to the L2TP peer had been dropped.
2014-10-21tun(4) has a pipex session which is used for multicast internally, itYASUOKA Masahiko
wasn't freeed when the interface is destroyed. Free it properly. ok dlg
2014-10-20pipex(4): Converted to use pool(9)Masao Uebayashi
OK blambert@ yasuoka@
2014-10-18Whitespace.Masao Uebayashi
2014-10-17reset all the pfsync packet state before calling ip_output inDavid Gwynne
pfsync_sendout. more specifically, move the reset of sc->sc_len to PFSYNC_MINPKT above ip_output. this prevents a situation where ipsec via ip_output calls pfsync_update_tdb for syncing the ipsec flow to a peer, which accounts for the tdb in the next pfsync packet, before unwinding back to pfsync_output which resets the accounting we just did. the next pfsync packet to be sent out will be allocated with a short length because sc_len is wrong, and the long lists of things (eg, the tdb) can overwrite memory after the mbuf. this manifests as incorrect poisoning or xsimpleq entry corruption in mbufs still in a pool, or random corruption of m->m_next on other mbufs in the system. bug found, fix tested, and ok stsp@
2014-10-14Document that lo0 must be present on your system by panic(9)ing if weMartin Pieuchot
cannot create it. Suggested by and ok claudio@
2014-10-14Use rtfree() instead of RTFREE(), NULLify some free'd route pointers andMartin Pieuchot
kill the macro. ok mikeb@, henning@
2014-10-10s/lenght/length/ in commentsStuart Henderson
2014-10-08print ipv6cp by name rather than number in "0x8057 output <...>" debug lines,Stuart Henderson
as already done for lcp/ipcp/pap/chap
2014-10-08Tedu the RB-tree of addresses, thanks for all the fish!Martin Pieuchot
ok henning@, dlg@, mikeb@
2014-10-08Use rtalloc1() instead of rtalloc_noclone().Martin Pieuchot
ok henning@, phessler@
2014-10-07remove preliminary AOE (ata over ethernet) support. not finished afterTed Unangst
many years and wide spread demand for support never materialized. time to pack it in.
2014-10-07when running bpf on an outgoing vlan interface that doesnt have aDavid Gwynne
parent that doesnt offload the tag insertion, we need to chop the vlan subheader out before the filter is run, not after. this moves the mbuf surgery out from the bpf layer into the vlan layer. ok henning@ jmatthew@
2014-10-07Since the list of mpe(4) interfaces is only accessed in process context,Martin Pieuchot
it does not need to be protected by splnet(). Rafael Zalamena agrees, no objection from the MPLS gang.
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-05fix typo in comment: correspoding -> correspondingLawrence Teo
2014-10-02Local routes that do not translate a protocol address into a link-layerMartin Pieuchot
address should not be flagged with RTF_LLINFO. With this fix, arp(8) will no longer report an incomplete entry for lo0. ok claudio@
2014-10-01sl(4) is no more, thanks for all the fish!Martin Pieuchot
2014-10-01Use the modern way of checking if a local route exists.Martin Pieuchot
With KAME's hack of ``loopbacked host route'' we were checking if the associated interface was a loopback. Now simply look for the correct flags, which also helps reducing the number of ifp pointer derefences. ok claudio@
2014-09-30Stop using the RB-tree in ifa_ifwithaddr() and make it lookup overMartin Pieuchot
all the per-interface lists of addresses. Teaks and ok bluhm@, ok kspillner@, claudio@
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-23lock around the sysctl code that sets the bpf buffer sizes so if we everDavid Gwynne
get multiple processes in the kernel these sets cant race and allow people to set the default greater than the max.
2014-09-22remove a stupid comment above bpfilterattach about how we dont do anythingDavid Gwynne
in it cos its only called on new systems, when it actually does. we dont care about old or new systems, just ours. the code is called, the fact that it exists is enough to demonstrate that.
2014-09-22stash a pointer to bpf_d in the knotes kn_hook instead of the device id.David Gwynne
we refcount the bpf_d memory correctly so it cant go away. possibly worse is the bpf minor id could be reused between the kq calls, so this seems safer to me. also avoids a list walk on each op cos the ptr is just there.
2014-09-22it's easy to allow bpfwrites bigger than MCLBYTES now that we haveDavid Gwynne
large cluster pools and MCLGETI. we could chain mbufs if we want to go even bigger. with a fix from Mathieu- <naabed at poolp dot org>
2014-09-22if you request a read timeout and then use kqueues to wait for them, youDavid Gwynne
end up waiting until the ring is full cos the timeout doesnt get set up when the knote is registered.
2014-09-19better boundchecks in validation; from Guy Harris; ok millert@ dlg@Otto Moerbeek
2014-09-19passing M_NOWAIT to m_tag_get means it can fail, which could hitDavid Gwynne
the failure path which leaks all the stuff the previous code in bpf_movein allocates. since it's only called from bpfwrite, use M_WAIT instead to make it reliable and just get rid of the bogus failure code. ok miod@
2014-09-18ansify function declaration things.David Gwynne
ok mpi@ henning@ krw@
2014-09-15Remove non-standard <sys/dkstat.h> header. It has not contained anythingMiod Vallat
related to disk stastics for almost 17 years, and the remaining userland-visible defines duplicate those found in <sys/sched.h>. Move the remaining _KERNEL defines to <sys/tty.h> where they belong, and update all users to cope with this. ok kettenis@
2014-09-08When logging a packet to a listener on the pflog0 interface, theAlexander Bluhm
function pflog_bpfcopy() is setting up a packet description with pf_setup_pdesc(). When pf_setup_pdesc() is droppig a bad packet, it increments the the pf status counters. This way bad packets could be accounted multiple times. Now pflog_bpfcopy() passes a reason pointer NULL to indicate that no accounting should be done. From Florian Riehm; OK henning@
2014-09-08remove uneeded route.h includesJonathan Gray
ok miod@ mpi@
2014-09-03Treat broadcast entries like local ones and give them the highestMartin Pieuchot
route priority. While here document a RTM_ADD message is only send to userland for local entries. ok mikeb@, florian@