Skip to content

Instantly share code, notes, and snippets.

@matsumotory
Created February 15, 2017 10:59
Show Gist options
  • Save matsumotory/7e77aa252098e716f6a37e8068b39ca6 to your computer and use it in GitHub Desktop.
Save matsumotory/7e77aa252098e716f6a37e8068b39ca6 to your computer and use it in GitHub Desktop.
if ((rcv_len = recvfrom(raw_socket, buf, sizeof(buf), 0, (struct sockaddr *)&dst, &fromlen) == -1)) {
ERROR("recvfrom", "recvfrom", 4);
}
printf("rec_len: %d\n", rcv_len); /* rcv_len is always 0 */
if ((rcv_len = recvfrom(raw_socket, buf, sizeof(buf), 0, (struct sockaddr *)&dst, &fromlen)) == -1) {
ERROR("recvfrom", "recvfrom", 4);
}
printf("rec_len: %d\n", rcv_len);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment