summaryrefslogtreecommitdiffstats
path: root/sys/netinet6 (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Convert more MH_ALIGN() to m_align(). Also switch from m_gethdr/M_GETHDRclaudio2018-12-031-3/+3
| | | | | | calls to m_get/M_GET calls because M_MOVE_PKTHDR() is initialising the pkthdr and so it is not needed when allocation the header. OK bluhm@
* MH_ALIGN -> m_alignclaudio2018-11-301-2/+2
| | | | OK bluhm@
* Retire dom_rtkeylen from struct domain. Nothing is using this anymore.claudio2018-11-191-2/+1
| | | | | It was used by the original patricia tree. OK mpi@
* M_LEADINGSPACE() and M_TRAILINGSPACE() are just wrappers forclaudio2018-11-093-7/+7
| | | | | | m_leadingspace() and m_trailingspace(). Convert all callers to call directly the functions and remove the defines. OK krw@, mpi@
* Remove the last few XXX rdomain markers. Even those functions respect theclaudio2018-11-091-2/+1
| | | | | rdomain now and are therefor rdomain save. OK mpi@
* RT_TABLEID_MAX is 255, fix places that assumed that it is less than 255.reyk2018-10-102-5/+5
| | | | | | | | | | rtable 255 is a valid routing table or domain id that wasn't handled by the ip[6]_mroute code or by snmpd. The arrays in the ip[6]_mroute code where off by one and didn't allocate space for rtable 255; snmpd simply ignored rtable 255. All other places in the tree seem to handle RT_TABLEID_MAX correctly. OK florian@ benno@ henning@ deraadt@
* Do not join node information multicast group (RFC 4620).florian2018-10-053-68/+3
| | | | | | | | Benno removed code to answer ICMP queries over 4 years ago. Aham Brahmasmi (aham.brahmasmi AT gmx.com) points out that we still joined the group though. OK sthen, bluhm, kn
* Revert the inpcb table mutex commit. It triggers a witness panicbluhm2018-10-043-26/+4
| | | | | | | in raw IP delivery and UDP broadcast loops. There inpcbtable_mtx is held and sorwakeup() is called within the loop. As sowakeup() grabs the kernel lock, we have a lock ordering problem. found by Hrvoje Popovski; OK deraadt@ mpi@
* As a step towards per inpcb or socket locks, remove the net lockbluhm2018-09-203-5/+27
| | | | | | | | | | | | for netstat -a. Introduce a global mutex that protects the tables and hashes for the internet PCBs. To detect detached PCB, set its inp_socket field to NULL. This has to be protected by a per PCB mutex. The protocol pointer has to be protected by the mutex as netstat uses it. Always take the kernel lock in in_pcbnotifyall() and in6_pcbnotify() before the table mutex to avoid lock ordering problems in the notify functions. OK visa@
* Add reference counting for inet pcb, this will be needed when webluhm2018-09-132-4/+7
| | | | | | start locking the socket. An inp can be referenced by the PCB queue and hashes, by a pf mbuf header, or by a pf state key. OK visa@
* Convert inetctlerrmap to u_char like inet6ctlerrmap. That is alsobluhm2018-09-112-28/+4
| | | | | what FreeBSD does. Remove old #if 0 version of inet6ctlerrmap. OK mpi@
* Make the distribution of in_ and in6_ functions in in_pcb.c andbluhm2018-09-111-47/+182
| | | | | | | | | in6_pcb.c consistent, to ease comparing the code. Move all inet6 functions to in6_. Bring functions in both source files in same order. Cleanup the include section. Now in_pcb.c is a superset of in6_pcb.c. The latter contains all the special implementations. Just moving arround, no code change intended. OK mpi@
* Instead of calculating the mbuf packet header length here and there,bluhm2018-09-101-9/+2
| | | | | | put the algorithm into a new function m_calchdrlen(). Also set an uninitialized m_len to 0 in NFS code. OK claudio@
* During fragment reassembly, mbuf chains with packet headers werebluhm2018-09-101-2/+5
| | | | | | | created. Add a new function m_removehdr() do convert packet header mbufs within the chain to regular mbufs. Assert that the mbuf at the beginning of the chain has a packet header. found by Maxime Villard in NetBSD; from markus@; OK claudio@
* factor error code in icmp6_mtudisc_clone(); ok kn@ florian@miko2018-09-051-17/+12
|
* Add per-TDB counters and a new SADB extension to export them tompi2018-08-281-2/+4
| | | | | | userland. Inputs from markus@, ok sthen@
* Do not add ::1 on non-default lo(4) as intended.mpi2018-08-261-7/+11
| | | | Reported by and ok sthen@
* frag6_slowtimo: push NET_LOCK into frag6_freef around icmp6_error.cheloha2018-08-221-8/+6
| | | | | | | | | | | | | | | icmp6_error() still probably needs the NET_LOCK, as the call chain icmp6_error -> icmp6_reflect -> rt_match -> rt_clone -> rtrequest is possible. The fragment discard loop in frag6_slowtimo and the other cleanup bits in frag6_freef do not require it however. So push the lock down into frag6_freef around icmp6_error. Prompted by mpi. Discussed with bluhm and kn. Regress test help by bluhm. Additional testing by kn. ok kn@ visa@ mpi@
* Account when the next nd6_timer_to is scheduled in nd6_timer()florian2018-08-031-2/+4
| | | | | | | | | otherwise nd6_llinfo_settimer() might wrongly assume that a timeout is already scheduled earlier and not schedule one itself. This in turn lead to the neighbor cache no longer updating because neighbor solicitations were not send. Observed by many. OK kn
* Introduce RTM_CHGADDRATTR to inform userland on the route socket whenflorian2018-07-121-1/+9
| | | | | | | | | | an attribute of an address is changed. For now it's used when IPv6 duplicate address detection finishes. With this slaacd(8) can find out if a configured address is not duplicated without the need to poll. OK phessler, benno, claudio
* Introduce ipsec_output_cb() to merge duplicate code and account formpi2018-07-121-2/+6
| | | | | | | | dropped packets in the output path. While here fix a memory leak when compression is not needed w/ IPcomp. ok markus@
* Disambiguate the source of panics in sys/net* by adding __func__nayden2018-07-111-3/+3
| | | | | magic constant to panic() calls. ok benno@ henning@ tb@
* rtm_send() the cloned routes because of ICMP mtu changes. Until nowclaudio2018-07-111-1/+2
| | | | | | | these changes to the routing table have not been visible whereas the RTM_DELETE of those routes have been. Remove this inconsistency. Input and OK mpi@ OK henning@
* When an interface doesn't have a layer 2 address in6_get_soii_ifid()florian2018-07-101-4/+20
| | | | | | | | | | failes and then later on a in in6_get_ifid() a layer 2 address is "borrowed" from from another interface. Do the "borrowing" in in6_get_soii_ifid(), too so that semantically opaque interface identifiers work for these kind of interfaces, too. OK phessler, benno
* When an interface doesn't have a layer 2 address in6_get_ifid()florian2018-07-101-13/+2
| | | | | | | | | | | | | | | | | tries to "borrow" one from another interface. But then it checks if the U bit is set int the generated EUI64 address and rejects it. On the other hand for interfaces that do have a layer 2 address this check is skipped, so relax it for the "borrowing" case, too. With this one gets stable link local addresses on e.g. gre(4) interfaces on certain virtualisation environments depending which mac addresses get picked for the vio(4) interfaces while previously we would end up with a random IP on every reboot. Reported by Aaron A. Glenn via phessler. OK phessler, benno
* It was possible to leak the control mbuf in raw ip user requestbluhm2018-07-051-2/+11
| | | | | | with sendmsg(2) and MSG_OOB. Sync the code in udp, rip, and rip6_usrreq. Add an inp NULL check in rip6_usrreq for consistency. OK benno@ mpi@
* Prevent a mbuf double free by not freeing it along the error-path inanton2018-07-041-3/+5
| | | | | | rip{6,}_usrreq() since soreceive() will free it. ok bluhm@
* Assert that the INP_IPV6 in in6_pcbconnect() is correct. Just callbluhm2018-06-141-1/+3
| | | | | in_pcbconnect() to avoid the address family maze in syn_cache_get(). input claudio@; OK mpi@
* Push the KERNEL_LOCK() inside route_input().mpi2018-06-111-3/+1
| | | | ok visa@, tb@
* The global zero addresses must not change, mark them constant.bluhm2018-06-072-4/+4
| | | | OK tb@ visa@
* Use variable names for rtable and rdomain consistently in the in_pcbbluhm2018-06-031-3/+4
| | | | | functions. discussed with and OK mpi@ visa@
* Consistently call the inpcb table parameter "table" in in6_pcbnotify().bluhm2018-06-031-3/+3
| | | | OK visa@ mpi@
* Move the declarations of the raw ip and ip6 pcb tables into thebluhm2018-06-021-2/+1
| | | | | in_pcb.h header file. OK mpi@ visa@
* All places that call carp_lsdrop() use the interface pointer already.bluhm2018-05-212-9/+7
| | | | | | | | It does not make sense to call if_get() again, just pass ifp as parameter. Move the IFT_CARP check into the function instead of doing it everywhere. Replace the inverted match variable logic with simple returns. OK mpi@ friehm@
* Make the code a bit easier on the eye by factoring repeated embeddedtb2018-05-121-53/+44
| | | | | | scope check and clearing of the scope id into separate functions. input & ok visa, mpi
* Nuke unused ia6_createtime struct member.florian2018-05-062-6/+3
| | | | OK tb
* Continue refactoring and cleanup of in6_ioctl().tb2018-05-061-32/+40
| | | | | | | | | Hoist privilege check to the top and split out handling of SIOCAIFADDR_IN6 and SIOCDIFADDR_IN6 into a separate function. Merge tangled switches and simplify the code paths. tested by hrvoje ok visa
* Split handling of SIOCGIF*_IN6 into a separate function in6_ioctl_get()tb2018-05-041-107/+142
| | | | | | | that only needs a read lock. Tested by hrvoje ok visa
* Push the NET_LOCK() down in in6_control() similar to what was donetb2018-05-023-41/+67
| | | | | | | | | for in_control(). Protect mrt6_ioctl() and nd6_ioctl() with a read lock and in6_ioctl with the NET_LOCK() while establishing a single exit point. tested by kn ok florian, mpi, visa
* Make the ramdisks compile again, we don't have MROUTING on them.florian2018-04-241-7/+7
| | | | Found the hard way.
* Push NET_LOCK down in the default ifioctl case.pirofti2018-04-243-9/+17
| | | | | | | For the PRU_CONTROL bit the NET_LOCK surrounds in[6]_control() and on the ENOTSUPP case we guard the driver if_ioctl functions. OK mpi@
* Run duplicate address detection again if an existing address getsflorian2018-04-241-5/+8
| | | | | | | | updated from userland that was marked duplicated or tentative. Otherwise we would just lose the duplicated / tentative state and assume that the address is now unique and usable. OK kn
* Use memcpy instead of bcopy when the memory does not overlap.dhill2018-03-273-14/+14
| | | | OK deraadt@ florian@
* In ip6_output() check that the interface of a route is valid. Forbluhm2018-03-211-1/+12
| | | | | | IPv4 we do the same and there are races that triggers it. Increment the statistics counter for both. from markus@; OK mpi@
* Consistently spell "IPsec" in comments and debug outputs.mpi2018-03-161-2/+2
| | | | From Raf Czlonka, ok sthen@
* Calculate RFC7217 link-local style addresses the same way asflorian2018-03-131-2/+2
| | | | | | | | | | | | | slaacd(8). RFC 7217 states (section 5, page 9): | The Interface Identifier is finally obtained by taking as many | bits from the RID value (computed in the previous step) as | necessary, starting from the least significant bit. Problem in slaacd pointed out by semarie@. OK sthen, phessler
* Remove almost unused `flags' argument of suser().mpi2018-02-192-10/+10
| | | | | | | The account flag `ASU' will no longer be set but that makes suser() mpsafe since it no longer mess with a per-process field. No objection from millert@, ok tedu@, bluhm@
* Use IP6_SOIIKEY_LEN instead of hardcoded value.mpi2018-02-121-2/+2
| | | | from semarie@, ok benno@
* add an ipv6 "don't fragment" flag to mbufs for ip6_output to use.dlg2018-02-111-2/+5
| | | | | | | | | | if you need to send an ipv6 packet with ip6_send(), there's no DF bit in an ipv6 packet and no way to pass the ip6 options to ip6_output to tell it to not allow fragmentation. this adds an M_IPV6_DF_OUT "checksum" flag so something creating ipv6 packets a long way from ip6_output can easily tell it to not allow fragmentation. grumbling and ok claudio@
* rework gif to be more consistent.dlg2018-02-101-2/+18
| | | | | | | | | while here, give us support for mpls in gif on ipv6. this moves all the gif handling into if_gif, eg, the mpls handling is no longer in ip_etherip.c. ok claudio@