Skip to content

Instantly share code, notes, and snippets.

View neoxic's full-sized avatar

Arseny Vakhrushev neoxic

View GitHub Profile
@neoxic
neoxic / udp_client.c
Last active April 2, 2020 04:55
SOCK_DGRAM: race between 'bind()' and 'connect()' leads to a connected socket receiving unfiltered datagrams
#include <err.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#define check(expr) if ((expr) == -1) err(1, "%s", #expr);