net/ipv6/syncookies.c
Source file repositories/reference/linux-study-clean/net/ipv6/syncookies.c
File Facts
- System
- Linux kernel
- Corpus path
net/ipv6/syncookies.c- Extension
.c- Size
- 7865 bytes
- Lines
- 290
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/tcp.hlinux/random.hlinux/siphash.hlinux/kernel.hnet/secure_seq.hnet/ipv6.hnet/tcp.hnet/tcp_ecn.h
Detected Declarations
function cookie_hashfunction secure_tcp_syn_cookiefunction check_tcp_syn_cookiefunction __cookie_v6_init_sequencefunction cookie_v6_init_sequencefunction __cookie_v6_checkexport __cookie_v6_init_sequenceexport __cookie_v6_check
Annotated Snippet
if (IS_ERR(dst)) {
SKB_DR_SET(reason, IP_OUTNOROUTES);
goto out_free;
}
}
req->rsk_window_clamp = READ_ONCE(tp->window_clamp) ? :dst_metric(dst, RTAX_WINDOW);
/* limit the window selection if the user enforce a smaller rx buffer */
full_space = tcp_full_space(sk);
if (sk->sk_userlocks & SOCK_RCVBUF_LOCK &&
(req->rsk_window_clamp > full_space || req->rsk_window_clamp == 0))
req->rsk_window_clamp = full_space;
tcp_select_initial_window(sk, full_space, req->mss,
&req->rsk_rcv_wnd, &req->rsk_window_clamp,
ireq->wscale_ok, &rcv_wscale,
dst_metric(dst, RTAX_INITRWND));
/* req->syncookie is set true only if ACK is validated
* by BPF kfunc, then, rcv_wscale is already configured.
*/
if (!req->syncookie)
ireq->rcv_wscale = rcv_wscale;
ireq->ecn_ok &= cookie_ecn_ok(net, dst);
tcp_rsk(req)->accecn_ok = ireq->ecn_ok && cookie_accecn_ok(th);
ret = tcp_get_cookie_sock(sk, skb, req, dst);
if (!ret) {
SKB_DR_SET(reason, NO_SOCKET);
goto out_drop;
}
out:
return ret;
out_free:
reqsk_free(req);
out_drop:
sk_skb_reason_drop(sk, skb, reason);
return NULL;
}
Annotation
- Immediate include surface: `linux/tcp.h`, `linux/random.h`, `linux/siphash.h`, `linux/kernel.h`, `net/secure_seq.h`, `net/ipv6.h`, `net/tcp.h`, `net/tcp_ecn.h`.
- Detected declarations: `function cookie_hash`, `function secure_tcp_syn_cookie`, `function check_tcp_syn_cookie`, `function __cookie_v6_init_sequence`, `function cookie_v6_init_sequence`, `function __cookie_v6_check`, `export __cookie_v6_init_sequence`, `export __cookie_v6_check`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.