summaryrefslogtreecommitdiff
path: root/sys/netinet
AgeCommit message (Collapse)Author
2023-06-24Fix typo in comment.msaitoh
2023-06-16White space fixes. No binary changes.rin
2023-06-02follow the steps of Andrew Doran (ad) commit and fix more s/loose/lose/ typos.andvar
also s/beyound/beyond/ and few others along the way, mainly in comments.
2023-04-19Again allow multicast packets to be sent from unnumbered interfaces.mlelstv
2023-04-19Revert "Fix panic on packet sending via a route with rt_ifa of AF_LINK."ozaki-r
The fix is mistakenly upstreamed.
2023-04-07Select virtual address as sender if backing interface is anonymous.mlelstv
Use correct scope for IPv6.
2023-04-05remove some double ee typos in comments.andvar
2023-03-26Use backing device to send advertisements. Otherwise the packets originatemlelstv
from the virtual MAC address, which confuses switches.
2022-12-11Need larger fat pointers for 128bit cache lines.mlelstv
2022-12-07Refactor ip_encap.[ch]knakahara
- remove encap_attach() which is no longer used - remove USE_RADIX code in ip_encap.c, which is used for encap_attach() only - remove mask members in encaptab
2022-12-07gif(4), ipsec(4) and l2tp(4) use encap_attach_addr().knakahara
2022-12-07Implement encap_attach_addr() which is used by IP-encaped tunnels.knakahara
The tunnels attached by encap_attach() can process receiving packets fastly as the softc is searched by radix-tree. However, the tunnels cannot use priority function which decides tunnel's softc by not only source and destination but also other informations. On the other hand, the tunnels attached by encap_attach_func() can use priority function. However, the tunnels can be slow receiving processing as the softc is searched by linear search (and uses each priority function). encap_attach_addr() can be used for tunnels which is fixed tunnel source address and tunnel destination address. The tunnels attached by encap_attach_addr() is searched by thmap(9), so the receiving processing can be fast. Moreover, the tunnels can use priority function.
2022-12-07refactor: use typedef for ip_encap priority functionknakahara
2022-11-25Support explicit unnumbered interface.knakahara
Currently, NetBSD supports implicit unnumbered interface by setting the same IP address to two interfaces. However, such interface is not treated as unnumbered when one of the interfaces is being changed and has been changed IP address. That behavior can be harmful for some routing daemons.
2022-11-21Fix panic on packet sending via a route with rt_ifa of AF_LINK.knakahara
A route with rt_ifa of AF_LINK can be set by some routing daemons when it adds a route that has a gateway of AF_LINK. If there is no address on a target interface, the kernel sets an AF_LINK address of the interface to rt_ifa of the route. In that case, a variable of a local address in ip_output (ia) can be NULL and we need more NULL-checks of it.
2022-11-19Make arp have its own mowneryamt
This helped me to debug mbuf leaks in arp. (if_arp.c rev. 1.298)
2022-11-17Fix sending broken RTM_DELADDR message in some operations.knakahara
Here is mininum reproduction operation. ==================== # ifconfig ixg0 172.16.0.1/29 # route monitor & # ifconfig pppoe0 172.16.0.1/32 0.0.0.1 ==================== The broken RTM_DELADDR is the following. ==================== got message of size 72 on Thu Nov 17 12:50:42 2022 #13: len 72, got message of size 80 on Thu Nov 17 12:50:42 2022 RTM_DELADDR: address being removed from iface: len 80, pid 3552, metric 0, addrflags: 0 sockaddrs: 0xb4<NETMASK,IFP,IFA,BRD> Q00.00.ff.ff.ff.ff.00.00.00.00.00.00.00.00 pppoe0 default default ==================== This problem is related to the following two commit. (1) https://github.com/NetBSD/src/commit/b0210214689f17ec08988acd7ef8ae9cdc4c68bc that is, sys/netinet/in.c:r1.183 (2) https://github.com/NetBSD/src/commit/61bad33c44f2f6a01a030e8aa5840c015716792a that is, sys/netinet/in.c:r1.185 (1) adds in_scrubaddr() for old addresses to in_ifinit() without checking IFA_ROUTE. And then, (2) removes in_ifscrub() for POINTTOPOINT interface in in_control0. The removed in_ifscrub() is called with checking IFA_ROUTE. It seems these modifications about checking IFA_ROUTE logic causes this problem, however the real reason is calling in_ifscrub() for the interface which does not have IPv4 address. So, scrubbing old address processing should be done only if the interface already has IPv4 address.
2022-11-15arp: Validate ARP source hardware address matches Ethernet sourceroy
RFC 5227 section 1.1 states that for a DaD ARP probe the sender hardware address must match the hardware address of the interface sending the packet. We can now verify this by checking the mbuf tag PACKET_TAG_ETHERNET_SRC. This fixes an obsure issue where an old router was sending out bogus ARP probes. Thanks to Ryo Shimizu <ryo@nerv.org> for the re-implementation.
2022-11-15Revert prior.roy
2022-11-14arp: Validate L2 sender hardware address matches ARP proberoy
RFC 5227 section 1.1 states that for a DaD ARP probe the sender hardware address must match the hardware address of the interface sending the packet. We can now verify this by checking the mbuf packet header. This fixes an obsure issue where an old router was sending out bogus ARP probes.
2022-11-04ipcb: add/update the description of functionsozaki-r
From rmind-smpnet patches
2022-11-04inpcb: replace leading white spaces with tabsozaki-r
2022-11-04inpcb: get rid of parentheses for return valueozaki-r
2022-11-04inpcb: use NULLozaki-r
2022-11-04inpcb: use in_port_t for port numbersozaki-r
2022-11-04inpcb: use pool_cache instead of poolozaki-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-31tcp: fix wrong logic in tcp_dropozaki-r
Pointed out by mlelstv@
2022-10-30tcp: restore NULL check for inp in tcp_ctloutputozaki-r
2022-10-29tcp: restore NULL checks for inpozaki-r
2022-10-29inpcb: fix for kernels without INET6ozaki-r
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-28Remove in_pcb_hdr.hozaki-r
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-15fix various typos in documentation and comments.andvar
mainly in words functionality, functional, function.
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-20syncache: make some functions staticozaki-r
2022-09-20tcp: separate syn cache stuffs into tcp_syncache.[ch] filesozaki-r
No functional change.
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-03Convert ARP from a legacy netisr to pktqueue.thorpej
2022-09-02Remove unnecessary inclusion of <net/netisr.h>.thorpej
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-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-06s/blity/bility/ in various words, mainly in comments.andvar
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.