aboutgitcodebugslistschat
path: root/tcp.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-03-20 21:11:14 +0100
committerStefano Brivio <sbrivio@redhat.com>2021-03-20 22:19:15 +0100
commit9f8049931370426f43d704a288113596ea3ea6e6 (patch)
treefca7f6df3e587e63a7d0e2170802aa3fb30ca150 /tcp.c
parent00f3bcea0531f50be49793f9c51bf370756aa55b (diff)
downloadpasst-9f8049931370426f43d704a288113596ea3ea6e6.tar
passt-9f8049931370426f43d704a288113596ea3ea6e6.tar.gz
passt-9f8049931370426f43d704a288113596ea3ea6e6.tar.bz2
passt-9f8049931370426f43d704a288113596ea3ea6e6.tar.lz
passt-9f8049931370426f43d704a288113596ea3ea6e6.tar.xz
passt-9f8049931370426f43d704a288113596ea3ea6e6.tar.zst
passt-9f8049931370426f43d704a288113596ea3ea6e6.zip
tcp: Don't dereference IPv4 addresses
...sometimes they're not valid pointers. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp.c')
-rw-r--r--tcp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tcp.c b/tcp.c
index 7561460..a7b9dbc 100644
--- a/tcp.c
+++ b/tcp.c
@@ -866,7 +866,7 @@ static uint32_t tcp_seq_init(struct ctx *c, int af, void *addr,
} __attribute__((__packed__)) in = {
.src = *(struct in_addr *)addr,
.srcport = srcport,
- .dst = *(struct in_addr *)c->addr4,
+ .dst = { c->addr4 },
.dstport = dstport,
};