For testing this was validated on master with the setup below.
## environment
```
root@kam:~# uname -a
Linux kam 6.1.0-9-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.27-1 (2023-05-08) x86_64
GNU/Linux
```
```
root@kam:~# lsb_release -a
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
```
```
root@kam:~# kamailio -I
Print out of kamailio internals
Version: kamailio 5.9.0-dev1 (x86_64/linux)
Default config: /usr/local/etc/kamailio/kamailio.cfg
Default paths to modules: /usr/local/lib64/kamailio/modules
Compile flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE,
USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, Q_MALLOC, F_MALLOC,
TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE,
USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
MAX_RECV_BUFFER_SIZE=262144
MAX_SEND_BUFFER_SIZE=262144
MAX_URI_SIZE=1024
BUF_SIZE=65535
DEFAULT PKG_SIZE=8MB
DEFAULT SHM_SIZE=64MB
ADAPTIVE_WAIT_LOOPS=1024
TCP poll methods: poll, epoll_lt, epoll_et, sigio_rt, select
Source code revision ID: unknown
Compiled with: gcc 12.2.0
Compiled architecture: x86_64
Compiled on: 16:39:25 Apr 23 2024
Thank you for flying kamailio!
```
## setup
1. compile kamalio and all modules outlined in [kamailio.cfg][1] (a simplified version of
a routing config with the most popular modules loaded to ensure none of them crash from
the changes)
2. install mariadb-server and run `kamdbctl create`
3. add `test` table / data to kamailio DB using [test.sql][2]
4. create a self signed key/cert pair in `/usr/local/etc/kamailio`
5. configure network defines per your server in `/usr/local/etc/kamailio/kamailio.cfg`
6. run kamailio: `kamailio -P /var/run/kamailio/kamailio.pid -m 512 -M 128 -E -e -DD`
## run test
send a call via any uac to the server and watch the output from the foreground kamailio
process:
```
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:876:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] test1: -2,147,483,000
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:877:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] test2: 0
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:878:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] test3: 2,147,483,000
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:879:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] test4: 4,294,967,000
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:881:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] (local) var(test1)=-2147483000
vn(test1)=-2147483000 avp(test1)=-2147483000 shv(test1)=-2147483000
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:883:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] (local) var(test2)=0 vn(test2)=0
avp(test2)=0 shv(test2)=0
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:885:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] (local) var(test3)=2147483000
vn(test3)=2147483000 avp(test3)=2147483000 shv(test3)=2147483000
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:887:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] (local) var(test4)=-296 vn(test4)=-296
avp(test4)=-296 shv(test4)=-296
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:889:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] (signed) test1: -2,147,483,000
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:890:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] (signed) test2: 0
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:891:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] (signed) test3: 2,147,483,000
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:892:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] (unsigned) test4: 0
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:893:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] (unsigned) test5: 2,147,483,000
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:894:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] (unsigned) test6: 4,294,967,000
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:896:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] (db) var(test1)=-2147483000
vn(test1)=-2147483000 avp(test1)=-2147483000 shv(test1)=-2147483000
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:898:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] (db) var(test2)=0 vn(test2)=0 avp(test2)=0
shv(test2)=0
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:900:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] (db) var(test3)=2147483000
vn(test3)=2147483000 avp(test3)=2147483000 shv(test3)=2147483000
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:902:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] (db) var(test4)=0 vn(test4)=0 avp(test4)=0
shv(test4)=0
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:904:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] (db) var(test5)=2147483000
vn(test5)=2147483000 avp(test5)=2147483000 shv(test5)=2147483000
(65041) INFO: [/usr/local/etc/kamailio/kamailio.cfg:906:DEFAULT_ROUTE]
[skpqdsqmwemdnhx@devbox1:INVITE:<null>] (db) var(test6)=4294967000
vn(test6)=4294967000 avp(test6)=4294967000 shv(test6)=4294
```
The private variables hold the correct unsigned value with the patches applied..
[1]:
https://github.com/devopsec/kamailio/blob/uint_test_files/kamailio.cfg
[2]:
https://github.com/devopsec/kamailio/blob/uint_test_files/test.sql
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3828#issuecomment-2078208236
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3828/c2078208236(a)github.com>