From: Alan Cox Date: Tue, 14 Nov 2017 00:43:30 +0000 (+0000) Subject: networking: Fixes and updates X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=0ef800874dff0d6c1375978e93b4b6aadf657d57;p=FUZIX.git networking: Fixes and updates Provide a 'connection has been reset rudely' callback Fix the confusion between sd.err and s->s_error Hopefully get the error handling on read/write correct now At this point it seems to be behaving sanely. --- diff --git a/Kernel/include/net_native.h b/Kernel/include/net_native.h index a519aea3..a0f00b64 100644 --- a/Kernel/include/net_native.h +++ b/Kernel/include/net_native.h @@ -21,7 +21,6 @@ struct sockdata { void *socket; - uint8_t err; uint8_t ret; uint8_t event; /* Waiting events to go to user space */ #define NEV_STATE 1 @@ -51,6 +50,7 @@ struct sockmsg { #define NE_ROOM 5 #define NE_DATA 6 #define NE_SHUTR 7 +#define NE_RESET 8 struct netevent { uint8_t socket; diff --git a/Kernel/include/netdev.h b/Kernel/include/netdev.h index eb05d4aa..77b590a4 100644 --- a/Kernel/include/netdev.h +++ b/Kernel/include/netdev.h @@ -125,5 +125,5 @@ extern arg_t net_shutdown(struct socket *s, uint8_t how); /* bit 0 rd, bit 1 wr extern void netdev_init(void); extern struct socket *sock_find(uint8_t type, uint8_t sv, struct sockaddrs *sa); extern void sock_init(void); - +extern int sock_error(struct socket *s); extern struct netdevice net_dev; diff --git a/Kernel/syscall_net.c b/Kernel/syscall_net.c index bf05b80b..d40c5b60 100644 --- a/Kernel/syscall_net.c +++ b/Kernel/syscall_net.c @@ -470,7 +470,7 @@ arg_t _connect(void) if (net_connect(s)) return -1; if (sock_wait_leave(s, 0, SS_CONNECTING)) { - /* API oddity, thanks Berkley */ + /* API oddity, thanks Berkeley */ if (udata.u_error == EAGAIN) udata.u_error = EINPROGRESS; return -1;