diff --git a/README.md b/README.md index 12702b06c0985e203a5283b6f0719d8adc36fda9..61226d1ab3c3c83bb8c20cdaae64e826060f71f9 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ There are some papers ([;login: October 2013](https://www.usenix.org/system/file ### Linux (Ubuntu) For installing the required packages run: ``` -sudo apt-get install git libsctp-dev bison flex +sudo apt-get install make git libsctp-dev bison flex ``` Then download the sources, compile them and install the files: ``` diff --git a/gtests/net/packetdrill/packet_socket_linux.c b/gtests/net/packetdrill/packet_socket_linux.c index 95e852bdf23158cf0bf8a74fdb3cced05e735f72..8abf10666bc4422ab32e4c63cbb5489dcc5a249b 100644 --- a/gtests/net/packetdrill/packet_socket_linux.c +++ b/gtests/net/packetdrill/packet_socket_linux.c @@ -80,6 +80,8 @@ static void bind_to_interface(int fd, int interface_index) */ static void packet_socket_setup(struct packet_socket *psock) { + struct timeval tv; + psock->packet_fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); if (psock->packet_fd < 0) die_perror("socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL))"); @@ -92,6 +94,12 @@ static void packet_socket_setup(struct packet_socket *psock) bind_to_interface(psock->packet_fd, psock->index); set_receive_buffer_size(psock->packet_fd, PACKET_SOCKET_RCVBUF_BYTES); + + + /* Pay the non-trivial latency cost to enable timestamps now, before + * the test starts, to avoid significant delays in the middle of tests. + */ + ioctl(psock->packet_fd, SIOCGSTAMP, &tv); } /* Add a filter so we only sniff packets we want. */ diff --git a/gtests/net/packetdrill/parser.y b/gtests/net/packetdrill/parser.y index bd598c0fda356bf1456b71622041935f3cb4365d..4f2b04edbb3b422506c037a7e065ae1dfca4f890 100644 --- a/gtests/net/packetdrill/parser.y +++ b/gtests/net/packetdrill/parser.y @@ -2596,7 +2596,7 @@ opt_ip_info ; ip_ecn -: NO_ECN { $$ = ECN_NONE; } +: NO_ECN { $$ = ECN_NONE; } | ECT0 { $$ = ECN_ECT0; } | ECT1 { $$ = ECN_ECT1; } | ECT01 { $$ = ECN_ECT01; } diff --git a/gtests/net/packetdrill/run_packet.c b/gtests/net/packetdrill/run_packet.c index 305acbb1a53dc5f33b98054bf2f528433d0d5b76..f03a4db237d3e3a5546df6404b4b3853d05f1704 100644 --- a/gtests/net/packetdrill/run_packet.c +++ b/gtests/net/packetdrill/run_packet.c @@ -278,7 +278,7 @@ static struct socket *handle_listen_for_script_packet( if (!match) return NULL; - if (socket != NULL) + if (socket == NULL) socket = setup_new_child_socket(state, packet); if (packet->sctp != NULL) {