Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
69bdbf32
Commit
69bdbf32
authored
Apr 10, 2013
by
Marcin Siodelski
Browse files
[991] Use pktinfo to pass control messages on Linux only.
parent
37861324
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/dhcp/pkt_filter_inet.cc
View file @
69bdbf32
...
...
@@ -162,7 +162,10 @@ PktFilterInet::receive(const Iface& iface, const SocketInfo& socket_info) {
pkt
->
setRemotePort
(
from_port
);
pkt
->
setLocalPort
(
socket_info
.
port_
);
#ifdef IP_PKTINFO
// In the future the OS-specific code may be abstracted to a different
// file but for now we keep it here because there is no code yet, which
// is specific to non-Linux systems.
#if defined (IP_PKTINFO) && defined (OS_LINUX)
struct
cmsghdr
*
cmsg
;
struct
in_pktinfo
*
pktinfo
;
struct
in_addr
to_addr
;
...
...
@@ -223,7 +226,10 @@ PktFilterInet::send(uint16_t sockfd, const Pkt4Ptr& pkt) {
m
.
msg_iov
=
&
v
;
m
.
msg_iovlen
=
1
;
#ifdef IP_PKTINFO
// In the future the OS-specific code may be abstracted to a different
// file but for now we keep it here because there is no code yet, which
// is specific to non-Linux systems.
#if defined (IP_PKTINFO) && defined (OS_LINUX)
// Setting the interface is a bit more involved.
//
// We have to create a "control message", and set that to
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment