Skip to content

Commit 04ae782

Browse files
committed
codelab: forward: fix compiler warning
1 parent faf7c49 commit 04ae782

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

codelab/forward.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,5 +217,7 @@ main(int argc, char **argv)
217217

218218
main_loop(netmap_port_one, netmap_port_two, udp_port);
219219

220+
(void)pkt_select; /* silence the compiler */
221+
220222
return 0;
221223
}

codelab/sink.c

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

24-
2524
static int stop = 0;
2625

2726
static void
@@ -61,7 +60,6 @@ static int
6160
main_loop(const char *netmap_port, int udp_port)
6261
{
6362
while (!stop) {
64-
(void)udp_port_match; /* silence the compiler */
6563
}
6664

6765
return 0;
@@ -128,5 +126,7 @@ main(int argc, char **argv)
128126

129127
main_loop(netmap_port, udp_port);
130128

129+
(void)udp_port_match; /* silence the compiler */
130+
131131
return 0;
132132
}

codelab/swap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ pkt_udp_port_swap(char *buf)
6969
/* Filter out non-UDP traffic. */
7070
return 0;
7171
}
72-
udph = (struct udphdr *)(iph + 1);
73-
tmp = udph->uh_sport;
72+
udph = (struct udphdr *)(iph + 1);
73+
tmp = udph->uh_sport;
7474
udph->uh_sport = udph->uh_dport;
75-
udph->uh_dport = tmp;
75+
udph->uh_dport = tmp;
7676

7777
return 1;
7878
}

0 commit comments

Comments
 (0)