X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udp.c;h=945d1d053749269a67d29d3cecfd8a2a1c8c302c;hb=a25b1149662cae9a8fad70405d195b73f74f3fdd;hp=f02a05ce4f8c712146a760c5405037e8d7522292;hpb=389070fed67552c613ce5afd3cdb436f8f8c538f;p=secnet.git diff --git a/udp.c b/udp.c index f02a05c..945d1d0 100644 --- a/udp.c +++ b/udp.c @@ -47,8 +47,7 @@ struct udp { }; static int udp_beforepoll(void *state, struct pollfd *fds, int *nfds_io, - int *timeout_io, const struct timeval *tv, - uint64_t *now) + int *timeout_io) { struct udp *st=state; if (*nfds_io<1) { @@ -61,12 +60,11 @@ static int udp_beforepoll(void *state, struct pollfd *fds, int *nfds_io, return 0; } -static void udp_afterpoll(void *state, struct pollfd *fds, int nfds, - const struct timeval *tv, uint64_t *now) +static void udp_afterpoll(void *state, struct pollfd *fds, int nfds) { struct udp *st=state; struct sockaddr_in from; - int fromlen; + socklen_t fromlen; struct notify_list *n; bool_t done; int rv; @@ -196,7 +194,7 @@ static void udp_phase_hook(void *sst, uint32_t new_phase) st->loc.file,st->loc.line); } - memset(&addr, 0, sizeof(addr)); + FILLZERO(addr); addr.sin_family=AF_INET; addr.sin_addr.s_addr=htonl(st->addr); addr.sin_port=htons(st->port); @@ -274,14 +272,14 @@ static list_t *udp_apply(closure_t *self, struct cloc loc, dict_t *context, d=i->data.dict; j=dict_find_item(d,"address",False,"udp",st->loc); - st->addr=j?st->addr=string_item_to_ipaddr(j, "udp"):INADDR_ANY; + st->addr=j?string_item_to_ipaddr(j, "udp"):INADDR_ANY; st->port=dict_read_number(d,"port",True,"udp",st->loc,0); st->rbuf=find_cl_if(d,"buffer",CL_BUFFER,True,"udp",st->loc); st->authbind=dict_read_string(d,"authbind",False,"udp",st->loc); l=dict_lookup(d,"proxy"); if (l) { st->use_proxy=True; - memset(&st->proxy,0,sizeof(st->proxy)); + FILLZERO(st->proxy); st->proxy.sin_family=AF_INET; i=list_elem(l,0); if (!i || i->type!=t_string) {