Lines Matching refs:IP_HDRINCL

204  * This test checks the behavior of the IP_HDRINCL socket option, which
221 * Try to receive or set the IP_HDRINCL flag on a TCP socket.
229 if (getsockopt(sock, IPPROTO_IP, IP_HDRINCL, flag, &len) == 0)
230 err(-1, "test_ip_hdrincl(): initial getsockopt(IP_HDRINCL)");
238 if (setsockopt(sock, IPPROTO_IP, IP_HDRINCL, flag, sizeof(flag[0]))
240 err(-1,"test_ip_hdrincl(): setsockopt(IP_HDRINCL) on TCP "
244 errx(-1, "test_ip_hdrincl(): setsockopt(IP_HDRINCL) on TCP "
251 * Try to receive or set the IP_HDRINCL flag on a UDP socket.
259 if (getsockopt(sock, IPPROTO_IP, IP_HDRINCL, flag, &len) == 0)
260 err(-1, "test_ip_hdrincl(): getsockopt(IP_HDRINCL) on UDP "
264 errx(-1, "test_ip_hdrincl(): getsockopt(IP_HDRINCL) on UDP "
268 if (setsockopt(sock, IPPROTO_IP, IP_HDRINCL, flag, sizeof(flag[0]))
270 err(-1, "test_ip_hdrincl(): setsockopt(IP_HDRINCL) on UDP "
274 errx(-1, "test_ip_hdrincl(): setsockopt(IP_HDRINCL) on UDP "
303 if (getsockopt(sock, IPPROTO_IP, IP_HDRINCL, flag, &len) < 0)
304 err(-1, "test_ip_hdrincl(): getsockopt(IP_HDRINCL) on raw "
316 * Enable the IP_HDRINCL flag.
319 if (setsockopt(sock, IPPROTO_IP, IP_HDRINCL, flag, sizeof(flag[0]))
321 err(-1, "test_ip_hdrincl(): setsockopt(IP_HDRINCL, 1)");
324 * Check that the IP_HDRINCL flag was set.
329 if (getsockopt(sock, IPPROTO_IP, IP_HDRINCL, flag, &len) < 0)
330 err(-1, "test_ip_hdrincl(): getsockopt(IP_HDRINCL) after "
334 errx(-1, "test_ip_hdrincl(): getsockopt(IP_HDRINCL) "
344 * Reset the IP_HDRINCL flag to 0.
347 if (setsockopt(sock, IPPROTO_IP, IP_HDRINCL, flag, sizeof(flag[0]))
349 err(-1, "test_ip_hdrincl(): setsockopt(IP_HDRINCL, 0)");
352 * Check that the IP_HDRINCL flag was reset to 0.
357 if (getsockopt(sock, IPPROTO_IP, IP_HDRINCL, flag, &len) < 0)
358 err(-1, "test_ip_hdrincl(): getsockopt(IP_HDRINCL) after "
362 errx(-1, "test_ip_hdrincl(): getsockopt(IP_HDRINCL) "