summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2014-01-21Cleanup the abuse of x as the rn_addmask radix node. Since in mostClaudio Jeker
cases x is just used as a temp variable. Main offender is rn_addmask() which sets x once at the top uses it then late in the function and then starts reuing it for various other stuff. While there fix some for loops to while ones and fix one strange do { } while() loop. And since rn_search() can not return NULL remove one extra check. OK mpi@
2014-01-21allow pflow(4) to determine the src IP address based on the routeSebastian Benoit
table if flowsrc is not set. Now works with new udp checksum code. From Nathanael Rensen (nathanael.openbsd AT list DOT polymorpheus DOT com), tweak and ok florian@
2014-01-21Do not clean the multicast records of an interface when it is destroyedMartin Pieuchot
(unplugged). Even if it makes no sense to keep them around if the interface is no more, we cannot safely remove them since pcb multicast options might keep a pointer to them. Fixes a user after free introduced by the multicast address linking rewrite and reported by Alexey Suslikov, thanks! ok claudio@
2014-01-21Substitute crazy defines and convert some 0 to NULL.Martin Pieuchot
ok claudio@, henning@
2014-01-21introduce a way to match "any" interface, excluding loopback ones.Henning Brauer
pfi_kif_get annotates the kif with a flag indicating it is the "any" match pfi_kif_match obeys that flag ok benno
2014-01-20Remove an unneeded #ifndef bot radix.h and radix_mpath.h protect themselfClaudio Jeker
from multiple inclusion. OK mpi@
2014-01-20Try to be more consistent in how various variables are setup and named.Claudio Jeker
Also remove a memset that is already happeing because we use PR_ZERO on the allocation. Move two memmove to memcpy because the addrs can not overlap. Make some simple helper functions static __inline and remove one of the explicit rn_search inlines. OK mpi@
2014-01-20Get rid of the old routing message version 4 transition code beforeAlexander Bluhm
5.5 release. OK claudio@
2014-01-20tedu unused declaration. ok florian@Sebastian Benoit
2014-01-20support negated matches on the rcvif, ok dlg bennoHenning Brauer
2014-01-19Prettify; remove useless cast, reformat, fix TAILQ_FOREACH's.pelikan
No functional change. ok deraadt
2014-01-19RTF_MPATH is a flag userland needs to be able to pass in since it is usedClaudio Jeker
to set multipath routes. So since more then 2 month multipath was broken.
2014-01-19More cleanup in radix.c. Kill the rt_mkfreelist and replace it with aClaudio Jeker
radix_mask pool. With input and OK mikeb@ and henning@
2014-01-19Count the number of media words required only once. If the media wordsTheo de Raadt
change during M_WAITOK (note: no driver does this at the moment), then be careful to not copyout a truncated media word list, but return E2BIG. ok mikeb guenther kettenis
2014-01-19Start to reduce the madness in radix.c. This only used by the kernelClaudio Jeker
since ages so remove the bits used for userland compiles. OK mikeb@
2014-01-16Replaces a lookup to find the link-layer address by accessing the if_sadlMartin Pieuchot
member directly. ok mikeb@
2014-01-13Call all local valiables of type struct in6_ifaddr "ia6". This isAlexander Bluhm
consistent with struct ifaddr "ifa" and struct in_ifaddr "ia". OK mpi@
2014-01-12Remove no-op 'HIDE' macro from sppp code. This probably existed to allowStefan Sperling
for easy switching to static functions. But we don't usually have static functions in the kernel. ok deraadt mpi mikeb
2014-01-10replace the rest of the obsolete radix macrosTed Unangst
sprinkle 0 -> NULL where obvious ok millert mpi
2014-01-09replace Bcopy macro with memmove and memcpy. ok mpiTed Unangst
2014-01-08Name the local variables for struct ifaddr consistently "ifa".Alexander Bluhm
OK mikeb@
2014-01-08Perform manual malloc/free of a large object in pfkeyv2_send() toTheo de Raadt
reduce stack space requirements. ok mikeb mpi
2014-01-07Some follow-up fixes for IFID collision handling in IPv6CP.Stefan Sperling
Really change the link-local address in the unlikely event of an IFID collision, instead of going into an infinite conf-nak loop with the peer. To make the netinet6 code use the IPv6CP IFID in a new link-local address, in6_ifattach_linklocal() must accept a provided IFID. Replace the unused 'altifp' parameter with a new 'ifid' parameter for this purpose. Always use the latest suggested address in IPv6CP replies, even if the task to update the interface's address hasn't run yet. Also, clear the ifindex (KAME hack) in addresses sent during IPv6CP. ok mpi
2014-01-03Purging a queue requires it to be non-empty, not empty.pelikan
ok millert
2014-01-03Switch frequently allocated structs from malloc(M_DEVBUF) to separate pools.pelikan
ok henning, "looks fine" mikeb, input from guenther.
2014-01-03Make queues disappear correctly on interfaces being destroyed.pelikan
ok henning
2014-01-01Destroy the eligible list when detaching from an interface.pelikan
ok henning
2013-12-24rearrange/correct timeout conditionals to work better.Ted Unangst
fixes negative timeout panics. tested by sthen.
2013-12-22change pf_osfp_entry strings to unsigned, to help userlandTheo de Raadt
ok florian
2013-12-18Revert the *other* part of bpf.c's r1.84. May finally fix RD Thrush'sKenneth R Westerback
encounter with "timeout_add: to_ticks (-1) < 0". Pointed out by RD Thrush.
2013-12-12Fix invalid size to memcmp() in rn_lexobetter() introduced when theTodd C. Miller
hand-rolled loop was converted to memcmp(). From Kieran Devlin. OK markus@
2013-12-11Use an u_int32_t instead of an unsigned long to store the magic numberJeremie Courreges-Anglas
we're about to send. Should a bug on big-endian LP64 archs reported by James MacMahon (jwm at operand dot ca). ok millert@
2013-11-29panics still being reported. send bpf.c back to 1.85Ted Unangst
2013-11-28IFAFREE() was resurrected from the dead with the new bandwith subsytem,Martin Pieuchot
send it back in the Attic.
2013-11-28Change the way protocol multicast addresses are linked to an interface.Martin Pieuchot
Instead of linking multicast records to the first configured address of the corresponding protocol, making this address and its position in the global list special, add them to a new list directly linked to the interface descriptor. This new multicast address list is similar to the address list, all its elements contain a protocol agnostic part. This design allows us to be able to join a multicast group without necessarily having a configured address. That means IPv6 multicast kludges are no longer needed. Another benefit is to be able to add and remove an IP address from an interface without worrying about multicast records. That means that the global IPv4 list is no longer needed since the first configured address of an interface is no longer special. This new list might also be extended in the future to contain the link-layer addresses used to configure hardware filters. Tested by sthen@ and weerd@, ok mikeb@
2013-11-27Let's call a rtableid a rtableid.Martin Pieuchot
ok mikeb@, henning@, claudio@
2013-11-21split kernel parts of the if.h into a separate header file if_var.hMike Belopuhov
which allows us to modify ifnet structure in a relatively safe way; discussed with deraadt, ok mpi
2013-11-21Remove unneeded include.Martin Pieuchot
ok deraadt@
2013-11-20Convert sppp(4) to taskq; ok mikeb@ mpi@Stefan Sperling
2013-11-19provide forward declarations for structures ifnet and ifg_group;Mike Belopuhov
ok deraadt
2013-11-19Remove some FDDI/ATM leftovers.Martin Pieuchot
ok mikeb@, henning@, deraadt@, brad@, miod@
2013-11-18Fix potential null dereference.Charles Longeau
Found by LLVM/Clang Static Analyzer. ok benno@ henning@
2013-11-18The prio value of a pf match rule was overridden by a later passAlexander Bluhm
rule even if the latter had no prio flag. Fix match rules with prio to work as expected. Found by Roman Kravchuk; reported and tested by Alexey Suslikov; OK henning@
2013-11-18use arc4random() for ether_fakeaddr, because it is safeTheo de Raadt
ok tedu
2013-11-18Convert trunk(4) to use a detachhook, discussed at b2k13 with many.Martin Pieuchot
While here add a comment explaining detach hooks' order of execution when destroying/detaching an interface.
2013-11-17speelingDavid Gwynne
2013-11-16Remove dead assignments and now unused variables.Charles Longeau
Found by LLVM/Clang Static Analyzer. ok henning@ mikeb@ bluhm@
2013-11-15calculate the line in the sand before comparing it to ticks, which looksDavid Gwynne
more like the original conditional. if this doesnt fix rd thrushs panic, then this should be reverted to r1.85.
2013-11-15Revert 1.858, as it causes panics of inp:Christiano F. Haesbaert
kernel diagnostic assertion \"sotoinpcb(inp->inp_socket) == inp\" failed: file "../../../../netinet/tcp_input.c", line 646 Will think of a better fix.
2013-11-15After discussion with deraadt@ and Fernando Gont, it seems that theAlexander Bluhm
stack should still scan for IPv6 type 0 routing headers. There are OpenBSD routers running without pf and there are plenty of legacy implementations supporting RH0. Bring back the function ip6_check_rh0hdr() that I removed a month ago. As an improvement to the prevoius solution, only scan the header chain in ip6_input() if the packet has not been inspected by pf. Both implementations drop packets with RH0 anywhere in the extension header chain. OK mikeb@ henning@