From c1ddd026a2cc6d68a0d47033817a3d9b7670a71e 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 9bb1234..d2c0aad 100644 --- a/udp.c +++ b/udp.c @@ -137,9 +137,9 @@ static void udp_afterpoll(void *state, struct pollfd *fds, int nfds) } /* proxy protocol supports ipv4 transport only */ 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; ca.comm=&cc->ops; -- 2.11.0