Commit 56d10786 authored by filatov's avatar filatov
Browse files

fix sockaddr_len, fix pcap_offline

parent a5c8cae1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -134,8 +134,8 @@ static long timeval_diff (const pcap_o_timeval &x, const pcap_o_timeval &y)
}

void* pcap_offline_layer::thread() {
  struct pcap_o_pkthdr *pkt_header;
  struct pcap_o_pkthdr lh;
  pcap_o_pkthdr *pkt_header;
  pcap_o_pkthdr lh;
  const u_char *pkt_data;
  unsigned char pkt_count = 0;

+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
#include "t_layer.hh"
#include "params.hh"

#include <OctetString.hh>
#include <Octetstring.hh>

class PORT; //! Forward declaration of TITAN class

+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ void udp_layer::Handle_Fd_Event_Readable(int fd) {

  unsigned char buffer[2048] = {0};
  struct sockaddr_in from = {0};
  socklen_t len = 0; // Length of sender's address
  socklen_t len = sizeof(struct sockaddr_in); // Length of sender's address
  params params;
  int result = ::recvfrom(_fd, buffer, 1024, 0, (struct sockaddr *)&from, &len); // FIXME Add support of EAGAIN
  loggers::get_instance().log("udp_layer::receive_data: src_port = %s:%d, payload length = %d", ::inet_ntoa(from.sin_addr), ntohs(from.sin_port), result);