summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_route_addr.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-11-04Removed the unsafe nxt_memchr() wrapper for memchr(3).Alejandro Colomar1-6/+6
The casts are unnecessary, since memchr(3)'s argument is 'const void *'. It might have been necessary in the times of K&R, where 'void *' didn't exist. Nowadays, it's unnecessary, and _very_ unsafe, since casts can hide all classes of bugs by silencing most compiler warnings. The changes from nxt_memchr() to memchr(3) were scripted: $ find src/ -type f \ | grep '\.[ch]$' \ | xargs sed -i 's/nxt_memchr/memchr/' Reviewed-by: Andrew Clayton <a.clayton@nginx.com> Signed-off-by: Alejandro Colomar <alx@nginx.com>
2022-11-04Removed the unsafe nxt_memcmp() wrapper for memcmp(3).Alejandro Colomar1-2/+2
The casts are unnecessary, since memcmp(3)'s arguments are 'void *'. It might have been necessary in the times of K&R, where 'void *' didn't exist. Nowadays, it's unnecessary, and _very_ unsafe, since casts can hide all classes of bugs by silencing most compiler warnings. The changes from nxt_memcmp() to memcmp(3) were scripted: $ find src/ -type f \ | grep '\.[ch]$' \ | xargs sed -i 's/nxt_memcmp/memcmp/' Reviewed-by: Andrew Clayton <a.clayton@nginx.com> Signed-off-by: Alejandro Colomar <alx@nginx.com>
2022-07-26Supporting UNIX sockets in address matching.Alejandro Colomar1-0/+10
This closes #645 issue on GitHub. (Also moved a changelog line that was misplaced in a previous commit.)
2022-07-21Router: avoided undefined behaviour.Andrew Clayton1-1/+1
In src/nxt_http_route_addr.c::nxt_http_route_addr_pattern_parse() there was potentially undefined behaviour when shifting a 32 bit value by 32 bits, this could happen if cidr_prefix was 0. Promote the shiftee to unsigned long long to avoid this issue.
2021-08-12Introduced nxt_sockaddr_parse_optport() for addresses w/o ports.Oisin Canty1-18/+1
2020-01-28Fixed missing IPv6 checking in route-addr and an unused variable.Axel Duch1-2/+6
This closes #363 issue on Github. Thanks to to 洪志道 (Hong Zhi Dao).
2019-12-24Router: introducing routing on client address.Axel Duch1-0/+349