tools/testing/selftests/net/netfilter/sctp_collision.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/netfilter/sctp_collision.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/netfilter/sctp_collision.c- Extension
.c- Size
- 2523 bytes
- Lines
- 101
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
stdio.hstdlib.hstring.hunistd.harpa/inet.h
Detected Declarations
function main
Annotated Snippet
if (ret < 0) {
printf("Failed to connect to peer\n");
goto out;
}
ret = recvfrom(sd, buf, sizeof(buf), 0, (struct sockaddr *)&daddr, &len);
if (ret < 0) {
printf("Failed to recv msg %d\n", ret);
goto out;
}
ret = sendto(sd, buf, strlen(buf) + 1, 0, (struct sockaddr *)&daddr, len);
if (ret < 0) {
printf("Failed to send msg %d\n", ret);
goto out;
}
printf("Server: sent! %d\n", ret);
}
if (!strcmp(argv[1], "client")) {
usleep(300000); /* wait a bit for server's listening */
ret = connect(sd, (struct sockaddr *)&daddr, len);
if (ret < 0) {
printf("Failed to connect to peer\n");
goto out;
}
sleep(1); /* wait a bit for server's delayed INIT_ACK to reproduce the issue */
ret = sendto(sd, buf, strlen(buf) + 1, 0, (struct sockaddr *)&daddr, len);
if (ret < 0) {
printf("Failed to send msg %d\n", ret);
goto out;
}
ret = recvfrom(sd, buf, sizeof(buf), 0, (struct sockaddr *)&daddr, &len);
if (ret < 0) {
printf("Failed to recv msg %d\n", ret);
goto out;
}
printf("Client: rcvd! %d\n", ret);
}
ret = 0;
out:
close(sd);
return ret;
}
Annotation
- Immediate include surface: `stdio.h`, `stdlib.h`, `string.h`, `unistd.h`, `arpa/inet.h`.
- Detected declarations: `function main`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source 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.