From: Marcin Siodelski Date: Fri, 9 Sep 2016 10:35:35 +0000 (+0200) Subject: [master] Silenced cppcheck warning about unread variable. X-Git-Tag: trac5006_base~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93ab4a40f460190550b0f2e9a7719e1e6c004306;p=thirdparty%2Fkea.git [master] Silenced cppcheck warning about unread variable. This change was okayed on jabber. --- diff --git a/src/lib/dhcp/pkt_filter_inet.cc b/src/lib/dhcp/pkt_filter_inet.cc index b5aec1f038..1a0bb8e08a 100644 --- a/src/lib/dhcp/pkt_filter_inet.cc +++ b/src/lib/dhcp/pkt_filter_inet.cc @@ -162,14 +162,13 @@ PktFilterInet::receive(Iface& iface, const SocketInfo& socket_info) { pkt->setRemotePort(from_port); pkt->setLocalPort(socket_info.port_); - struct cmsghdr* cmsg; - cmsg = CMSG_FIRSTHDR(&m); - // Linux systems support IP_PKTINFO option which is used to retrieve the // destination address of the received packet. On BSD systems IP_RECVDSTADDR // is used instead. #if defined (IP_PKTINFO) && defined (OS_LINUX) struct in_pktinfo* pktinfo; + struct cmsghdr* cmsg = CMSG_FIRSTHDR(&m); + while (cmsg != NULL) { if ((cmsg->cmsg_level == IPPROTO_IP) && (cmsg->cmsg_type == IP_PKTINFO)) { @@ -192,6 +191,7 @@ PktFilterInet::receive(Iface& iface, const SocketInfo& socket_info) { #elif defined (IP_RECVDSTADDR) && defined (OS_BSD) struct in_addr* to_addr; + struct cmsghdr* cmsg = CMSG_FIRSTHDR(&m); while (cmsg != NULL) { if ((cmsg->cmsg_level == IPPROTO_IP) &&