BIND 10 trac991, updated. 5dc9b2f5c86bab3a7aec205a2f5cf91b2b6398e1 [991] Check for the IP_PKTINFO support in send/receive functions.
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Apr 5 18:45:57 UTC 2013
The branch, trac991 has been updated
via 5dc9b2f5c86bab3a7aec205a2f5cf91b2b6398e1 (commit)
from 23fa01352842de0a16314734ac061f87c81b662a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5dc9b2f5c86bab3a7aec205a2f5cf91b2b6398e1
Author: Marcin Siodelski <marcin at isc.org>
Date: Fri Apr 5 20:45:45 2013 +0200
[991] Check for the IP_PKTINFO support in send/receive functions.
-----------------------------------------------------------------------
Summary of changes:
src/lib/dhcp/pkt_filter_inet.cc | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dhcp/pkt_filter_inet.cc b/src/lib/dhcp/pkt_filter_inet.cc
index 9a2c74f..2e5cbed 100644
--- a/src/lib/dhcp/pkt_filter_inet.cc
+++ b/src/lib/dhcp/pkt_filter_inet.cc
@@ -158,13 +158,13 @@ PktFilterInet::receive(const Iface& iface, const SocketInfo& socket_info) {
pkt->setRemotePort(from_port);
pkt->setLocalPort(socket_info.port_);
+#ifdef IP_PKTINFO
struct cmsghdr* cmsg;
struct in_pktinfo* pktinfo;
struct in_addr to_addr;
memset(&to_addr, 0, sizeof(to_addr));
-#ifdef IP_PKTINFO
cmsg = CMSG_FIRSTHDR(&m);
while (cmsg != NULL) {
if ((cmsg->cmsg_level == IPPROTO_IP) &&
@@ -219,6 +219,7 @@ PktFilterInet::send(uint16_t sockfd, const Pkt4Ptr& pkt) {
m.msg_iov = &v;
m.msg_iovlen = 1;
+#ifdef IP_PKTINFO
// Setting the interface is a bit more involved.
//
// We have to create a "control message", and set that to
@@ -235,7 +236,8 @@ PktFilterInet::send(uint16_t sockfd, const Pkt4Ptr& pkt) {
memset(pktinfo, 0, sizeof(struct in_pktinfo));
pktinfo->ipi_ifindex = pkt->getIndex();
m.msg_controllen = cmsg->cmsg_len;
-
+#endif
+
pkt->updateTimestamp();
int result = sendmsg(sockfd, &m, 0);
More information about the bind10-changes
mailing list