Commit c6516775 authored by garciay's avatar garciay
Browse files

Compilation on Linux

parent edf338d4
Loading
Loading
Loading
Loading
+13 −10
Original line number Diff line number Diff line
@@ -97,26 +97,29 @@ pcap_layer::pcap_layer(const std::string& p_type, const std::string& param)
      *_bin2hex(buf, sizeof(buf), ifr.ifr_hwaddr.sa_data, 6) = 0;
      mac_src = buf;
      loggers::get_instance().user("pcap_layer::pcap_layer: local MAC is %s", mac_src.c_str());
      _params.[params::mac_src] = mac_src;
      _params[params::mac_src] = mac_src;
    }
  }

  // Accept ITS broadcasted messages
  std::string mac_bc;
  it = _params.find(params::mac_bc);
  if (it != _params.end() && !it->second.empty())
  if (it != _params.end() && !it->second.empty()) {
    mac_bc = it->second;
  else
  } else {
    mac_bc = "ffffffffffff";
  }

  if(mac_bc == mac_src || mac_src.empty())
  if ((mac_bc == mac_src) || mac_src.empty()) {
    filter = "ether dst " + mac_bc;
  else
  } else {
    filter = "( ether dst " + mac_bc + " or ether dst " + mac_src + " )";
  }

  if(! mac_src.empty())
  if (!mac_src.empty()) {
    // Reject ITS messages sent by this component
    filter += " and not ether src " + mac_src;
  }

  // Add user defined filter
  it = _params.find(std::string("filter"));