Commit d19dc250 authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[5003] Fixed PktFilterBPF for use of loopback interface on OSX.

parent afdb6335
......@@ -554,13 +554,18 @@ PktFilterBPF::send(const Iface& iface, uint16_t sockfd, const Pkt4Ptr& pkt) {
pkt->setLocalHWAddr(hwaddr);
}
/// Loopback interface requires special treatment. It doesn't
/// use the ethernet header but rather a 4-bytes long pseudo header
/// holding an address family type (see bpf.c in OS sources).
// Loopback interface requires special treatment. It doesn't
// use the ethernet header but rather a 4-bytes long pseudo header
// holding an address family type (see bpf.c in OS sources).
// On OSX, it even lacks pseudo header.
#if !defined (OS_OSX)
if (iface.flag_loopback_) {
writeAFPseudoHeader(AF_INET, buf);
}
#endif
} else {
// If this is not a loopback interface create Ethernet frame header.
if (!iface.flag_loopback_) {
// Ethernet frame header.
// Note that we don't validate whether HW addresses in 'pkt'
// are valid because they are validated by the function called.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment