Module: kamailio Branch: master Commit: 7cbbd8fb22ac0d57a5dd3883dee185b3bc0601e2 URL: https://github.com/kamailio/kamailio/commit/7cbbd8fb22ac0d57a5dd3883dee185b3...
Author: Matthias Urlichs matthias@urlichs.de Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2022-02-23T08:56:24+01:00
nathelper: Fix uninitialized data
- the IP checksum is part of the header and must be zeroed before checksumming - also silence another (benign) warning
---
Modified: src/modules/nathelper/nathelper.c
---
Diff: https://github.com/kamailio/kamailio/commit/7cbbd8fb22ac0d57a5dd3883dee185b3... Patch: https://github.com/kamailio/kamailio/commit/7cbbd8fb22ac0d57a5dd3883dee185b3...
---
diff --git a/src/modules/nathelper/nathelper.c b/src/modules/nathelper/nathelper.c index 22e128ac9c..cd657a7071 100644 --- a/src/modules/nathelper/nathelper.c +++ b/src/modules/nathelper/nathelper.c @@ -1786,7 +1786,7 @@ static inline int replace_sdp_ip( { str body1, oldip, newip; str body = *org_body; - int pf, pf1 = 0; + int pf = 0, pf1 = 0; str body2; char *bodylimit = body.s + body.len; int ret; @@ -2145,6 +2145,7 @@ static int send_raw(const char *buf, int buf_len, union sockaddr_union *to, ip->ip_off = 0; ip->ip_ttl = 69; ip->ip_p = 17; + ip->ip_sum = 0; ip->ip_src.s_addr = s_ip; ip->ip_dst.s_addr = to->sin.sin_addr.s_addr;