Thread (21 messages) 21 messages, 5 authors, 2023-01-28

Re: [PATCH v3 bpf-next 8/8] selftests/bpf: introduce XDP compliance test tool

From: Martin KaFai Lau <martin.lau@linux.dev>
Date: 2023-01-27 08:20:05
Also in: bpf, intel-wired-lan

On 1/26/23 10:36 AM, sdf@google.com wrote:
quoted
+    sockfd = socket(AF_INET, SOCK_DGRAM, 0);
+    if (sockfd < 0) {
+        fprintf(stderr, "Failed to create echo socket\n");
+        return -errno;
+    }
+
+    err = setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &optval,
+             sizeof(optval));
+    if (err < 0) {
+        fprintf(stderr, "Failed sockopt on echo socket\n");
+        return -errno;
+    }
+
+    err = bind(sockfd, (struct sockaddr *)&addr, sizeof(addr));
+    if (err) {
+        fprintf(stderr, "Failed to bind echo socket\n");
+        return -errno;
+    }
IIRC, Martin mentioned IPv6 support in the previous version. Should we
also make the userspace v6 aware by at least using AF_INET6 dualstack
sockets? I feel like listening on inaddr_any with AF_INET6 should
get us there without too much pain..
Yeah. Think about host that only has IPv6 address. A tool not supporting IPv6 is 
a no-go nowadays.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help