From: Ian Jackson Date: Thu, 2 Oct 2014 14:44:18 +0000 (+0100) Subject: comm: Use BUF_GET_BYTES X-Git-Tag: proposed.polypath.v3~40 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=65fdeaf998e6b147d2554ab3e6a82db542ad2df8;p=secnet.git comm: Use BUF_GET_BYTES There are two calls in udp_afterpoll which could use BUF_GET_BYTES. Convert them. Signed-off-by: Ian Jackson --- diff --git a/udp.c b/udp.c index 4512dd7..dc98782 100644 --- a/udp.c +++ b/udp.c @@ -127,9 +127,9 @@ static void udp_afterpoll(void *state, struct pollfd *fds, int nfds) /* proxy protocol supports ipv4 transport only */ FILLZERO(from); from.sa.sa_family=AF_INET; - memcpy(&from.sin.sin_addr,buf_unprepend(cc->rbuf,4),4); + BUF_GET_BYTES(unprepend,cc->rbuf,&from.sin.sin_addr,4); buf_unprepend(cc->rbuf,2); - memcpy(&from.sin.sin_port,buf_unprepend(cc->rbuf,2),2); + BUF_GET_BYTES(unprepend,cc->rbuf,&from.sin.sin_port,2); } struct comm_addr ca; FILLZERO(ca);