mirror of
https://passt.top/passt
synced 2025-05-21 00:35:34 +02:00
udp: Handle errors on UDP sockets
Currently we ignore all events other than EPOLLIN on UDP sockets. This means that if we ever receive an EPOLLERR event, we'll enter an infinite loop on epoll, because we'll never do anything to clear the error. Luckily that doesn't seem to have happened in practice, but it's certainly fragile. Furthermore changes in how we handle UDP sockets with the flow table mean we will start receiving error events. Add handling of EPOLLERR events. For now we just read the error from the error queue (thereby clearing the error state) and print a debug message. We can add more substantial handling of specific events in future if we want to. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
6bd8283bf9
commit
2fa91ee391
3 changed files with 92 additions and 0 deletions
3
util.h
3
util.h
|
@ -194,7 +194,10 @@ static inline const char *af_name(sa_family_t af)
|
|||
|
||||
#define SOCKADDR_STRLEN MAX(SOCKADDR_INET_STRLEN, SOCKADDR_INET6_STRLEN)
|
||||
|
||||
struct sock_extended_err;
|
||||
|
||||
const char *sockaddr_ntop(const void *sa, char *dst, socklen_t size);
|
||||
const char *str_ee_origin(const struct sock_extended_err *ee);
|
||||
|
||||
/**
|
||||
* mod_sub() - Modular arithmetic subtraction
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue