We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b16940b commit 0f2526aCopy full SHA for 0f2526a
1 file changed
codelab/sink.c
@@ -33,16 +33,16 @@ static inline int
33
udp_port_match(const char *buf, unsigned len, int udp_port)
34
{
35
struct ether_header *ethh;
36
- struct iphdr *iph;
+ struct ip *iph;
37
struct udphdr *udph;
38
39
ethh = (struct ether_header *)buf;
40
if (ethh->ether_type != htons(ETHERTYPE_IP)) {
41
/* Filter out non-IP traffic. */
42
return 0;
43
}
44
- iph = (struct iphdr *)(ethh + 1);
45
- if (iph->protocol != IPPROTO_UDP) {
+ iph = (struct ip *)(ethh + 1);
+ if (iph->ip_p != IPPROTO_UDP) {
46
/* Filter out non-UDP traffic. */
47
48
0 commit comments