{"record":{"id":"955f4f88f02f26bc","repo":"cloudflare/quiche","slug":"unsupported","errorCode":"Unsupported","errorMessage":"invalid address family","messagePattern":"invalid address family","errorType":"error_code","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"datagram-socket/src/datagram.rs","lineNumber":692,"sourceCode":"    }\n\n    fn into_fd(self) -> Option<OwnedFd> {\n        Some(into_owned_fd(self.into_std().ok()?))\n    }\n}\n\n#[cfg(unix)]\nimpl DatagramSocketSend for UnixDatagram {\n    #[inline]\n    fn poll_send(&self, cx: &mut Context, buf: &[u8]) -> Poll<io::Result<usize>> {\n        UnixDatagram::poll_send(self, cx, buf)\n    }\n\n    #[inline]\n    fn poll_send_to(\n        &self, _: &mut Context, _: &[u8], _: SocketAddr,\n    ) -> Poll<io::Result<usize>> {\n        Poll::Ready(Err(io::Error::new(\n            io::ErrorKind::Unsupported,\n            \"invalid address family\",\n        )))\n    }\n\n    #[cfg(target_os = \"linux\")]\n    #[inline]\n    fn poll_send_many(\n        &self, cx: &mut Context, bufs: &[ReadBuf<'_>],\n    ) -> Poll<io::Result<usize>> {\n        crate::poll_sendmmsg!(self, cx, bufs)\n    }\n}\n\n#[cfg(unix)]\nimpl DatagramSocketRecv for UnixDatagram {\n    #[inline]\n    fn poll_recv(","sourceCodeStart":674,"sourceCodeEnd":710,"githubUrl":"https://github.com/cloudflare/quiche/blob/9f96daa2c22a4468b0036fb0a0a3894eee6498b8/datagram-socket/src/datagram.rs#L674-L710","documentation":"datagram-socket's socket abstraction only implements send paths for AF_INET/AF_INET6 sockets. This poll_send_to is a fallback stub (for unsupported address families, e.g. unix/other) that always returns io::ErrorKind::Unsupported, so any send attempted through it can never succeed.","triggerScenarios":"Calling poll_send_to (via the AsyncSocket send path / poll_send machinery) on a datagram socket whose address family is not IPv4/IPv6, i.e. hitting the #[cfg] fallback implementation in datagram.rs:692.","commonSituations":"Passing a socket created from an address family other than IPv4/IPv6 into the datagram-socket send API; binding from a SocketAddr the crate does not support; misconfiguration on unusual platforms.","solutions":["Ensure the socket is bound to an IPv4 or IPv6 address before using poll_send_to","Check how the socket was constructed (from_datagram / socket2 setup) and only use AF_INET/AF_INET6","If you need another family, add a real implementation for that cfg branch instead of relying on the stub"],"exampleFix":"// before\nlet addr: SocketAddr = \"[::1]:443\".parse()?; // fine; but a unix/other family addr hits the stub\nsocket.send_to(buf, addr).await?;\n// after\nif !matches!(addr, SocketAddr::V4(_) | SocketAddr::V6(_)) {\n    return Err(io::Error::new(io::ErrorKind::Unsupported, \"non-IP family\"));\n}\nsocket.send_to(buf, addr).await?;","handlingStrategy":"validation","validationCode":"fn is_ip_family(addr: std::net::SocketAddr) -> bool {\n    matches!(addr, std::net::SocketAddr::V4(_) | std::net::SocketAddr::V6(_))\n}\n// call before send_to / poll_send_to\nif !is_ip_family(target) { return Err(...); }","typeGuard":"fn is_ip_family(addr: std::net::SocketAddr) -> bool {\n    matches!(addr, std::net::SocketAddr::V4(_) | std::net::SocketAddr::V6(_))\n}","tryCatchPattern":null,"preventionTips":["Always bind datagram sockets to IPv4 or IPv6 addresses","Check the socket's local_addr().is_ipv4()/is_ipv6() before sending","Treat io::ErrorKind::Unsupported from send paths as a configuration bug, not transient"],"tags":["io","udp","address-family"],"backgroundTag":"unsupported-operation","analyzedSha":"9f96daa2c22a4468b0036fb0a0a3894eee6498b8","analyzedAt":"2026-09-08T11:27:09.536Z","contentChangedAt":"2026-09-08T11:27:09.536Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}