]> git.bitcoin.ninja Git - flowspec-xdp/commitdiff
Satisfy BPF verifier with port swhich it can't prove are init'd values
authorMatt Corallo <git@bluematt.me>
Thu, 20 May 2021 14:26:41 +0000 (14:26 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 20 May 2021 14:26:41 +0000 (14:26 +0000)
xdp.c

diff --git a/xdp.c b/xdp.c
index 8f73d809ce75d6f7f886a07f0094e254d19da1a7..a32f605d3c4219f8713dda28b83452f4a7ab8f03 100644 (file)
--- a/xdp.c
+++ b/xdp.c
@@ -265,7 +265,7 @@ int xdp_drop_prog(struct xdp_md *ctx)
        const void *l4hdr = NULL;
        const struct tcphdr *tcp = NULL;
        uint8_t ports_valid = 0;
-       uint16_t sport, dport; // Host Endian! Only valid with tcp || udp
+       uint16_t sport = 0, dport = 0; // Host Endian! Only valid with tcp || udp
 
 #ifdef NEED_V4_PARSE
        if (eth_proto == BE16(ETH_P_IP)) {