Skip to content

Commit 3a5c2ee

Browse files
committed
codelab: struct udphdr: use BSD flavor
1 parent 08c2b55 commit 3a5c2ee

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

codelab/sink.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <netinet/udp.h>
2222
#include <netinet/tcp.h>
2323

24+
2425
static int stop = 0;
2526

2627
static void
@@ -49,7 +50,7 @@ udp_port_match(const char *buf, unsigned len, int udp_port)
4950
udph = (struct udphdr *)(iph + 1);
5051

5152
/* Match the destination port. */
52-
if (udph->dest == htons(udp_port)) {
53+
if (udph->uh_dport == htons(udp_port)) {
5354
return 1;
5455
}
5556

0 commit comments

Comments
 (0)