[OpenSIPS-Devel] [OpenSIPS/opensips] 89ae76: ip_addr: simplify check for RFC 1918

Bogdan Andrei IANCU noreply at github.com
Wed May 4 06:07:31 UTC 2022


  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 89ae768a7e5b09cbf83994d8e85319a446c6118b
      https://github.com/OpenSIPS/opensips/commit/89ae768a7e5b09cbf83994d8e85319a446c6118b
  Author: Peter Lemenkov <lemenkov at gmail.com>
  Date:   2022-04-24 (Sun, 24 Apr 2022)

  Changed paths:
    M ip_addr.c
    M modules/nat_traversal/nat_traversal.c
    M modules/nathelper/nathelper.c
    M transformations.c

  Log Message:
  -----------
  ip_addr: simplify check for RFC 1918

This function is used everywhere as follows:

```c
flag = (ip_addr_is_1918(x)==1) ? 1 : 0;
```

Let's just make it return the expected 0 or 1.

Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>


  Commit: 23a89965bbb750d3ebb50622538dc9ecfb87c44e
      https://github.com/OpenSIPS/opensips/commit/23a89965bbb750d3ebb50622538dc9ecfb87c44e
  Author: Bogdan Andrei IANCU <bogdan at opensips.org>
  Date:   2022-05-04 (Wed, 04 May 2022)

  Changed paths:
    M ip_addr.c
    M modules/nat_traversal/nat_traversal.c
    M modules/nathelper/nathelper.c
    M transformations.c

  Log Message:
  -----------
  Merge pull request #2820 from lemenkov/rfc1918_check_simplification

ip_addr: simplify check for RFC 1918


Compare: https://github.com/OpenSIPS/opensips/compare/47bfb3e3292a...23a89965bbb7



More information about the Devel mailing list