summaryrefslogtreecommitdiff
path: root/sys/netinet6
AgeCommit message (Collapse)Author
2023-03-29use carp mac address when replying to neighbor solicitations referringkardel
to carp interface addresses. unconfuses commercial routers
2023-03-22in6: make sure a user-specified checksum field is within a packetozaki-r
From OpenBSD
2023-03-20in6: reject setting negative values but -1 via setsockopt(IPV6_CHECKSUM)ozaki-r
Same as OpenBSD.
2023-01-27ipsec: remove unnecessary splsoftnetozaki-r
Because the code of IPsec itself is already MP-safe.
2022-12-22Fix typo in comment (s/mut be/msut be/). No functional change.msaitoh
2022-12-07gif(4), ipsec(4) and l2tp(4) use encap_attach_addr().knakahara
2022-11-04inpcb: get rid of parentheses for return valueozaki-r
2022-11-04inpcb: use in_port_t for port numbersozaki-r
2022-11-04inpcb: rename functions to in6pcb_*ozaki-r
2022-11-04inpcb: rename functions to inpcb_*ozaki-r
Inspired by rmind-smpnet patches.
2022-10-28Adjust dccp and sctp for struct inpcb separationozaki-r
2022-10-28inpcb: separate inpcb again to reduce the size of PCB for IPv4ozaki-r
The data size of PCB for IPv4 increased because of the merge of struct in6pcb. The change decreases the size to the original size by separating struct inpcb (again). struct in4pcb and in6pcb that embed struct inpcb are introduced. Even after the separation, users don't need to realize the separation and only have to use some macros to access dedicated data. For example, inp->inp_laddr is now accessed through in4p_laddr(inp).
2022-10-28Adjust pf, wg, dccp and sctp for struct inpcb integrationozaki-r
2022-10-28inpcb: integrate data structures of PCB into oneozaki-r
Data structures of network protocol control blocks (PCBs), i.e., struct inpcb, in6pcb and inpcb_hdr, are not organized well. Users of the data structures have to handle them separately and thus the code is cluttered and duplicated. The commit integrates the data structures into one, struct inpcb. As a result, users of PCBs only have to handle just one data structure, so the code becomes simple. One drawback is that the data size of PCB for IPv4 increases by 40 bytes (from 248 bytes to 288 bytes).
2022-10-24Clear saved_flags to avoid compile error on some archs.msaitoh
2022-10-24Fix PR kern/57037knakahara
Be able to change the behavior sending parameter changing routing messages. When set net.inet6.ip6.param_rt_msg=0, don't send parameter changing routing messages. When set net.inet6.ip6.param_rt_msg=1(default), send parameter changing routing messages by RTM_NEWADDR.
2022-10-21frag6: don't use spin mutex for frag6_lockozaki-r
frag6_lock is held during sending a packet (icmp6_error), so we must not use a spin mutex because we can acquire sleep locks on sending a packet. Also we don't need to use spin mutex for frag6_lock anymore because frag6_lock is now not used from hardware interrupt context.
2022-10-14Avoid error of "-Wreturn-local-addr", and simplify the logic.ryo
However, -Wreturn-local-addr is still disabled by default by GCC_NO_RETURN_LOCAL_ADDR in bsd.own.mk because it causes errors in other parts.
2022-09-20Remove routes on an address removal if the routes referencing to the ↵knakahara
address. Implemented by ozaki-r@n.o. A route that has a gateway is on a connected route can be invalid if the connected route is deleted, i.e., an associated address is removed. Traditionally NetBSD doesn't sweep such a route on the address removal. Sending packets over the route fails with "No route to host". Also the route holds an orphan ifaddr as rt_ifa that is destructed say by in_purgeaddr. If the same address is assgined again in such a state, there can be two different ifaddr objects with the same address. Until recently it's not a big problem because we can send packets anyway. However after MP-ification of the network stack, we can't send packets because we strictly check if rt_ifa (i.e., the (old) ifaddr) is valid. This change automatically removes such routes on a removal of an associated address to avoid keeping inconsistent routes.
2022-09-03Garbage-collect everything related to struct domain::dom_ifqueuesthorpej
(except dom_ifqueues itself, until the next kernel version bump). It's no longer used now that nothing uses the legacy netisr mechanism.
2022-09-02pktqueue: Re-factor sysctl handling.thorpej
Provide a new pktq_sysctl_setup() function that attaches standard pktq sysctl nodes below a specified parent node, with either a fixed node ID or CTL_CREATE to dynamically assign node IDs. Make all of the sysctl handlers private to pktqueue.c, and remove the INET- and INET6-specific pktqueue sysctl code from net/if.c.
2022-09-01nd6: Take ifnet psref around cprng_fast in nd6_slowtimo.riastradh
This may sleep on an adpative mutex, the global entropy lock, so pserialize is forbidden.
2022-08-29Add sysctl entry to control to send routing message for RTM_DYNAMIC.knakahara
Some routing daemons require such routing message to keep coherency. If we want to let kernel send such message, set net.inet.icmp.dynamic_rt_msg=1 for IPv4, net.inet6.icmp6.dynamic_rt_msg=1 for IPv6. Default(=0) is the same as before, that is, not send such routing message.
2022-08-22Add sysctl entry to enable/disable to use path MTU discovery for icmpv6 ↵knakahara
reflecting. If we want to use path MTU discovery for icmp reflecting set net.inet6.icmp6.reflect_pmtu=1. Default(=0) is the same as before, that is, use IPV6_MINMTU.
2022-08-07Remove extra whitespaces added by an ancient stupid script.tsutsui
2022-07-29Remove obsoleted comments.knakahara
These comments are added with IFNET_LOCK by in_pcb.c:r1.180 and in6_pcb.c:r1.162. And then, IFNET_LOCK codes are removed in in_pcb.c:r1.183 and in6_pcb.c:r1.166, however the comments have remained.
2022-06-15in6p_hash isn't used, either.knakahara
2022-06-09refactor: use TAILQ_FOREACH instead of TAILQ_FOREACH_SAFE about inpt_queue.knakahara
They don't use "ninph" pointer and don't remove elements.
2022-05-28fix various typos, mainly in comments.andvar
2022-02-23fix various typos in comments, mainly immediatly/immediately/,andvar
as well shared and recently fixed typos in OpenBSD code by Jonathan Grey.
2021-12-31s/quetion/question/andvar
2021-12-05s/existance/existence/ in comment.msaitoh
2021-12-05s/multple/multiple/ in comment.msaitoh
2021-09-21don't opencode kauth_cred_get()christos
2021-08-17fix multiplei repetitive typos in comments, messages and documentation. ↵andvar
mainly because copy paste code big amount of files are affected.
2021-08-17nd6: prevent ln from being freed while releasing held packetsozaki-r
2021-08-10PR kern/56348kardel
MTU discovery fails with IPv6 sockets bound to IPv4 mapped address pick up the IPv4 route for IPv4 mapped IPv6 address to get the correct MTU and not any unrelated/inappropriate MTU from IPv6 routes. IPv4 mapped IPv6 addresses are always handled by the IPv4 stack and MTU discovery is solely handled with the IPv4 routing table.
2021-08-02fix various typos in comments and log messages.andvar
2021-07-31fix typos in commentsandvar
2021-05-17Add a new link-aggregation pseudo interface named lagg(4)yamaguchi
- FreeBSD's lagg(4) based implementation - MP-safe and MP-scalable
2021-03-11flowlabel will never return anything other than 1 or 0.ryo
s/&&/&/
2021-03-10byte-flipping a random number is not very useful.christos
2021-03-08no need for ip6_id.c...christos
2021-03-07Amend missed messages:christos
netinet6: Pick IPv6 fragment ids uniformly at random. Expected number of packets before collision is ~2^16, about the same as we get for IPv4 with alternating disjoint random cycles. Keep it simple unless we determine we really need something much better for IPv6 than what IPv4 can achieve anyway. netinet6: Rip out now-unused IPv6 fragment id logic. (from riastradh)
2021-03-07netinet/netinet6: Add necessary includes to make these standalone.christos
(from riastradh)
2021-03-07netinet6: Mark randomid unused.christos
Will make merging and bisection easier if anything goes wrong with flow label or fragment id randomization changes. (from riastradh)
2021-02-19- Make ALIGNED_POINTER use __alignof(t) instead of sizeof(t). This is morechristos
correct because it works with non-primitive types and provides the ABI alignment for the type the compiler will use. - Remove all the *_HDR_ALIGNMENT macros and asserts - Replace POINTER_ALIGNED_P with ACCESSIBLE_POINTER which is identical to ALIGNED_POINTER, but returns that the pointer is always aligned if the CPU supports unaligned accesses. [ as proposed in tech-kern ]
2021-02-17- pass the alignment instead of the mask (as Roy asked and to match thechristos
other macro) - use alignof to determine that alignment and CTASSERT what we expect - remove unused macros
2021-02-15Fix the build.martin
Maybe there should be a ICMP6_HDR_ALIGNMENT, but for now there is only IP6_HDR_ALIGNMENT.
2021-02-14- centralize header align and pullup into a single inline functionchristos
- use a single macro to align pointers and expose the alignment, instead of hard-coding 3 in 1/2 the macros. - fix an issue in the ipv6 lt2p where it was aligning for ipv4 and pulling for ipv6.