Skip to content
Snippets Groups Projects
Commit 0cba786b authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud
Browse files

pjproject: ignore 192.0.0.0/29

From https://datatracker.ietf.org/doc/html/rfc7335#section-4
 " As defined in [RFC6333], this subnet
   is only present between the B4 and the Address Family Transition
   Router (AFTR) and never emits packets from this prefix "on the wire".
   464XLAT has the same need for a non-routed IPv4 prefix, and this same
   need may be common for other similar solutions"

Meaning that this candidate can be ignored. This is the second part of:

GitLab: #539
Change-Id: I52a906bc4ae5a1b1062cf6fe21dec216329c1d14
parent fbb4c953
Branches
No related tags found
No related merge requests found
diff --git a/pjlib/src/pj/ip_helper_generic.c b/pjlib/src/pj/ip_helper_generic.c
index d7bbf725e..3d64146df 100644
--- a/pjlib/src/pj/ip_helper_generic.c
+++ b/pjlib/src/pj/ip_helper_generic.c
@@ -116,6 +116,16 @@ static pj_status_t if_enum_by_af(int af,
continue; /* Skip when interface is down */
}
+ /* Ignore 192.0.0.0/29 address. cf https://datatracker.ietf.org/doc/html/rfc7335#section-4
+ */
+ if (af==pj_AF_INET() &&
+ (pj_ntohl(((pj_sockaddr_in*)ad)->sin_addr.s_addr) >> 4) == 201326592 /* 0b1100000000000000000000000000 which is 192.0.0.0 >> 4 */)
+ {
+ TRACE_((THIS_FILE, " address %s ignored (192.0.0.0/29 class)",
+ get_addr(ad), ad->sa_family));
+ continue;
+ }
+
/* Ignore 0.0.0.0/8 address. This is a special address
* which doesn't seem to have practical use.
*/
@@ -215,6 +225,16 @@ static pj_status_t if_enum_by_af(int af,
}
#endif
+ /* Ignore 192.0.0.0/29 address. cf https://datatracker.ietf.org/doc/html/rfc7335#section-4
+ */
+ if (af==pj_AF_INET() &&
+ (pj_ntohl(((pj_sockaddr_in*)ad)->sin_addr.s_addr) >> 4) == 201326592 /* 0b1100000000000000000000000000 which is 192.0.0.0 >> 4 */)
+ {
+ TRACE_((THIS_FILE, " address %s ignored (192.0.0.0/29 class)",
+ get_addr(ad), ad->sa_family));
+ continue;
+ }
+
/* Ignore 0.0.0.0/8 address. This is a special address
* which doesn't seem to have practical use.
*/
@@ -309,6 +329,16 @@ static pj_status_t if_enum_by_af(int af, unsigned *p_cnt, pj_sockaddr ifs[])
continue; /* Not address family that we want, continue */
}
+ /* Ignore 192.0.0.0/29 address. cf https://datatracker.ietf.org/doc/html/rfc7335#section-4
+ */
+ if (af==pj_AF_INET() &&
+ (pj_ntohl(((pj_sockaddr_in*)ad)->sin_addr.s_addr) >> 4) == 201326592 /* 0b1100000000000000000000000000 which is 192.0.0.0 >> 4 */)
+ {
+ TRACE_((THIS_FILE, " address %s ignored (192.0.0.0/29 class)",
+ get_addr(ad), ad->sa_family));
+ continue;
+ }
+
/* Ignore 0.0.0.0/8 address. This is a special address
* which doesn't seem to have practical use.
*/
......@@ -21,6 +21,8 @@
"0016-use-addrinfo-instead-CFHOST.patch",
"0017-CVE-2020-15260.patch",
"0018-CVE-2021-21375.patch",
"0019-ignore-down-interfaces.patch",
"0020-ignore-addresses-for-RFC7335.patch",
"0001-win-config.patch",
"0002-win-vs-gnutls.patch",
"0003-win-vs2017-props.patch"
......
......@@ -64,6 +64,7 @@ pjproject: pjproject-$(PJPROJECT_VERSION).tar.gz .sum-pjproject
$(APPLY) $(SRC)/pjproject/0017-CVE-2020-15260.patch
$(APPLY) $(SRC)/pjproject/0018-CVE-2021-21375.patch
$(APPLY) $(SRC)/pjproject/0019-ignore-down-interfaces.patch
$(APPLY) $(SRC)/pjproject/0020-ignore-addresses-for-RFC7335.patch
ifdef HAVE_ANDROID
$(APPLY) $(SRC)/pjproject/0001-android.patch
endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment