From 65fdeaf998e6b147d2554ab3e6a82db542ad2df8 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 2 Oct 2014 15:44:18 +0100 Subject: [PATCH] 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 --- udp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.30.2