summaryrefslogtreecommitdiff
path: root/sys/netinet6
AgeCommit message (Collapse)Author
2017-01-06Kill various splsoftnet().Martin Pieuchot
ok rzalamena@, visa@
2017-01-03Take the neighbor solicitation's source address from the packet toAlexander Bluhm
send if the mbuf contains the complete IPv6 header. The old check was wrong, it required one additional octet after the header. So the source address selection was depending on the layout of the mbuf chain. OK mpi@
2016-12-29Get rid of recursive splsoftnet() in in6_ifattach_linklocal().Martin Pieuchot
ok visa@
2016-12-27Move nd6 timer initialisation to nd6_init() and call timeout_set()Alexander Bluhm
only once during init. OK mpi@
2016-12-26Typo, "more then" -> "more than"Jeremie Courreges-Anglas
2016-12-23Do not call timeout_set(9) multiple times for nd6_slowtimo(), especiallyMartin Pieuchot
whem timeout_set_proc(9) is what we need. Found the hardway by and ok visa@, ok mikeb@, bluhm@
2016-12-22Remove all splsoftnet() from ND6 converting the non-recrusive ones toMartin Pieuchot
NET_LOCK(). ok bluhm@
2016-12-22Remove PIM support from the multicast stack.Rafael Zalamena
ok mpi@
2016-12-21Use __func__ in debug log to reduce noise when grepping.Martin Pieuchot
2016-12-21Remove recursive splsoftnet().Martin Pieuchot
ok bluhm@
2016-12-21Remove recursive splsoftnet() from the ioctl(2) path.Martin Pieuchot
ok bluhm@
2016-12-20A NET_LOCK() was is missing in tcp_sysctl() which shows up as splAlexander Bluhm
softnet assert failures. It is better to place the lock into net_sysctl() where all the protocol sysctls are called via pr_sysctl. As calling sysctl(2) is in the slow path, doing fine grained locking has no benefit. Many sysctl cases copy out a struct. Having a lock around that keeps the struct consistent. Put assertions in the protocol sysctls that need it. OK mpi@
2016-12-19Remove redundant splsoftnet().Martin Pieuchot
ok bluhm@
2016-12-19Introduce the NET_LOCK() a rwlock used to serialize accesses to the partsMartin Pieuchot
of the network stack that are not yet ready to be executed in parallel or where new sleeping points are not possible. This first pass replace all the entry points leading to ip_output(). This is done to not introduce new sleeping points when trying to acquire ART's write lock, needed when a new L2 entry is created via the RT_RESOLVE. Inputs from and ok bluhm@, ok dlg@
2016-12-02Rremoves 'struct route_in6 *' argument from in6_selectsrc().Martin Pieuchot
Move the corresponding code in in6_pcbselsrc(). This reduces differences with IPv4 and will help us to get rid of 'struct route*'. ok vgross@
2016-11-28Explicitly initialize rti_ifa when automagically adding a route.Martin Pieuchot
This will allow to strengthen checks when userland adds a route. ok phessler@, bluhm@
2016-11-28Remove multiple recursive splsoftnet().Martin Pieuchot
ok bluhm@
2016-11-28Assert that every slow/fast timeout routine is called at IPL_SOFTNET.Martin Pieuchot
This removes multipe recursive splsoftnet()/splx() dances.
2016-11-28Merge two "#ifdef MROUTING" blocks.Martin Pieuchot
It's one more step towards splitting ip6_input() in two and it reduces differences with v4. ok bluhm@
2016-11-21Assert that defrtrlist_update() is always called at IPL_SOFTNET.Martin Pieuchot
2016-11-21Assert that prelist_update() is always called at IPL_SOFTNET.Martin Pieuchot
While here use __func__ in debug strings to reduce noise when grepping.
2016-11-21Assert that in6_ifadd() is always called at IPL_SOFTNET.Martin Pieuchot
While here us __func__ in debug strings to reduce noise when grepping.
2016-11-21Enforce that pr_usrreq functions are called at IPL_SOFTNET.Martin Pieuchot
This will allow us to keep locking simple as soon as we trade splsoftnet() for a rwlock. ok bluhm@, claudio@
2016-11-18turn ipstat into a set of percpu counters.David Gwynne
each counter is identified by an enum value which correspond to the original members of the udpstat struct. udpstat_inc(udps_foo) replaces udpstat.udps_foo++ for the actual updates. udpstat_inc is a thin wrapper around counters_inc. counters are still returned to userland via the udpstat struct for now. ok mpi@ mikeb@ deraadt@
2016-11-16Bring icmp6_mtudisc_clone() in line with icmp_mtudisc_clone(). TheAlexander Bluhm
IPv4 dynamic route inherits the priority. Only clone from a valid IPv6 route. Do not use splsoftnet() in IPv6. Some stylistic changes to make the functions similar. OK mpi@
2016-11-16Inherit route label when creating dynamic routes for path MTU.Alexander Bluhm
From Rivo Nurges; OK claudio@ mpi@ phessler@
2016-11-15Kill recursive splsoftnet().Martin Pieuchot
ok phessler@, bluhm@ as part of a larger diff.
2016-11-14Automatically create a default lo(4) interface per rdomain.Martin Pieuchot
In order to stop abusing lo0 for all rdomains, a new loopback interface will be created every time a rdomain is created. The unit number will be the same as the rdomain, i.e. lo1 will be attached to rdomain 1. If this loopback interface is already in use it wont be possible to create the corresponding rdomain. In order to know which lo(4) interface is attached to a rdomain, its index is stored in the rtable/rdomain map. This is a long overdue since the introduction of rtable/rdomain. It also fixes a recent regression due to resetting the rdomain of an incoming packet reported by semarie@, Andreas Bartelt and Nils Frohberg. ok claudio@
2016-11-09Do not call splsoftnet() recursively, this won't work with a lock.Martin Pieuchot
Timers configured via rt_timer_add(9) always run at IPL_SOFTNET, so assert that rather than calling splsoftnet(). ok bluhm@
2016-11-07ARP and NDP timeouts mess with the routing table, so they need a processMartin Pieuchot
context. Convert them to timeout_set_proc(9).
2016-10-25bluhm@ pointed out that addr->sin6_port should be forced to zero sinceFlorian Obser
a port doesn't make sense for a raw socket. I forgot to commit this hunk in the previous commit. Sorry about that.
2016-10-25Fix bind(2)ing link local addresses to raw sockets by callingFlorian Obser
in6_pcbaddrisavail() which does all the checking for us instead of hand rolling half of it. Input & OK bluhm@ bluhm@ also points out that this relaxes the check for valid addresses a bit, deprecated addresses become valid for raw sockets. This should be fine, it brings raw sockets in line with udp/tcp sockets and it might be particularly interesting for debugging purposes.
2016-10-24When the IPv6 network stack receives an empty non atomic fragment,Alexander Bluhm
just drop it. It can never overlap existing content, there is no ambiguous payload. So save resources and do not try to insert it into the queue. This makes our IPv6 stack behave like pf fragment reassembly. OK deraadt@
2016-10-04Correct the flag checks inside rt_ifa_addlocal(9) and rt_ifa_dellocal(9).Martin Pieuchot
There's no need to insert an RTF_LOCAL route if it is already there, not if a route with the same destination exist. This fixes a KASSERT() triggered by adding an alias for an address already present in the ARP cache as reported by weerd@ and Peter J. Philipp. This should also fix a KASSERT() triggered by a NDP change reported by Sebastien Marie. ok bluhm@
2016-10-03Convert some of the remaining usages of time_second to time_uptime.Martin Pieuchot
time_second is unix time so it can be affected by clock changes. time_uptime is monotonic so it isnt affected by clock changes. that in turn means route expiries wont jump with clock changes if set against time_uptime. the expiry is translated into unix time for export to userland though. Should fix mismatch between route timers that were already converted and ND default routers that were still using time_second. Tested by matthieu@ and sthen@ ok sthen@, dlg@
2016-09-30Revert sending router solicitations when a prefix expires and go backFlorian Obser
to previous behaviour of starting quick, exponentially backing off and settling on every 60 seconds. sthen@ noticed that this broke the backing off when we don't receive an advertisment and so we would hammer the network every second which is particularly bad on wifi networks. OK sthen@
2016-09-26typo in commentStuart Henderson
2016-09-19convert bcopy to memcpy. from david hill. ok jcaTed Unangst
2016-09-15all pools have their ipl set via pool_setipl, so fold it into pool_init.David Gwynne
the ioff argument to pool_init() is unused and has been for many years, so this replaces it with an ipl argument. because the ipl will be set on init we no longer need pool_setipl. most of these changes have been done with coccinelle using the spatch below. cocci sucks at formatting code though, so i fixed that by hand. the manpage and subr_pool.c bits i did myself. ok tedu@ jmatthew@ @ipl@ expression pp; expression ipl; expression s, a, o, f, m, p; @@ -pool_init(pp, s, a, o, f, m, p); -pool_setipl(pp, ipl); +pool_init(pp, s, a, ipl, f, m, p);
2016-09-14Kill ip6_pcbopts, unused since the removal of IPV6_PKTOPTIONSJeremie Courreges-Anglas
ok mikeb@ mpi@
2016-09-14Delete dead code and useless parameter.Jeremie Courreges-Anglas
ok vgross@ henning@
2016-09-08If the same address is offered via NA, update the existing ``ifa''Martin Pieuchot
instead of creating a new one. Having two addresses mean that the old, deprecated one, would be selected instead of the new one. The issue could be triggered by reducing the pltime/vltime values sent by a router advertisement daemon. Problem reported and fix tested by Jens Sauer on bugs@
2016-09-06pool_setipl for various netinet and netinet6 bitsDavid Gwynne
thank you to everyone who helped reviewed these diffs ok mpi@
2016-09-04Purge routes attached to an address when this address is removed.Martin Pieuchot
This is done to stop using stale ifa attached to routes, which is the easiest way to make rtisvalid(9) MP-safe. sthen@ and henning@ like it, ok claudio@
2016-09-02in6_selectroute should never get a valid struct route * filled with somethingVincent Gross
else than AF_INET6. Ok florian@
2016-09-02Consider when a prefix expires when sending solicitations instead ofFlorian Obser
blindly always sending one every 60 seconds. repeated prodding & input naddy input & OK vgross
2016-09-02Go through the set function like normal people; no functional change.Florian Obser
OK benno@
2016-08-25Remove a check to expire received prefix.Martin Pieuchot
This check does not make sense since November 2000 when IPv6 autoconf address deletion has been made independent from prefix lifetimes. Fix a case when a route was added to the table but the corresponding address was not, leaving v6 unusable. Found the hardway by and ok sthen@
2016-08-25Simplify ip6_getpmtu() to use a 'struct rtentry *' instead of twoMartin Pieuchot
'struct route_in6 *'. This is another little step towards deprecating 'struct route{,_in6}' Inputs from and ok bluhm@
2016-08-24Kill ip6_forward_rt reducing differences between v4 and v6.Martin Pieuchot
A single forwarding cache is not the answer. The answer is 42... err PF! ok bluhm@