!14 [sync] PR-8: modify the getaddr method of ip

From: @openeuler-sync-bot 
Reviewed-by: @zengwefeng 
Signed-off-by: @zengwefeng
This commit is contained in:
openeuler-ci-bot 2022-03-28 01:29:49 +00:00 committed by Gitee
commit 461f3c281c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 48 additions and 1 deletions

View File

@ -0,0 +1,40 @@
From 8e0eb02df52d15dd4317abeddec427cdbac4da3c Mon Sep 17 00:00:00 2001
From: huyan <hu.huyan@huawei.com>
Date: Mon, 8 Jul 2019 02:10:44 +0000
Subject: [PATCH] backport bugfix rpcbind GETADDR return client ip
---
src/util.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/util.c b/src/util.c
index 4af8b9b..8b06c87 100644
--- a/src/util.c
+++ b/src/util.c
@@ -178,6 +178,11 @@ addrmerge(struct netbuf *caller, char *serv_uaddr, char *clnt_uaddr,
if (!bitmaskcmp(&SA2SINADDR(ifsa),
&SA2SINADDR(hint_sa), &SA2SINADDR(ifmasksa),
sizeof(struct in_addr))) {
+ if (getenv("RPCBIND_GETADDR_RETURN_CLIENT_IP") == NULL) {
+ bestif = ifap;
+ goto found;
+ }
+
if(!bestif) /* for compatibility with previous code */
bestif = ifap;
/* Is this an exact match? */
@@ -208,6 +213,11 @@ addrmerge(struct netbuf *caller, char *serv_uaddr, char *clnt_uaddr,
} else if (!bitmaskcmp(&SA2SIN6ADDR(ifsa),
&SA2SIN6ADDR(hint_sa), &SA2SIN6ADDR(ifmasksa),
sizeof(struct in6_addr))) {
+ if (getenv("RPCBIND_GETADDR_RETURN_CLIENT_IP") == NULL) {
+ bestif = ifap;
+ goto found;
+ }
+
if(!bestif) /* for compatibility with previous code */
bestif = ifap;
/* Is this an exact match? */
--
2.23.0

View File

@ -3,7 +3,7 @@
Name: rpcbind
Version: 1.2.6
Release: 1
Release: 2
Summary: Universal addresses to RPC program number mapper
License: BSD
@ -25,6 +25,7 @@ Patch101: %{name}-0.2.3-systemd-tmpfiles.patch
Patch102: %{name}-0.2.4-runstatdir.patch
Patch103: %{name}-0.2.4-systemd-service.patch
Patch104: %{name}-0.2.4-systemd-rundir.patch
Patch105: bugfix-rpcbind-GETADDR-return-client-ip.patch
Patch6001: CVE-2017-8779.patch
Patch9000: bugfix-listen-tcp-port-111.patch
@ -115,6 +116,12 @@ fi
%{_mandir}/man8/*.8.gz
%changelog
* Wed Feb 09 2022 yanglu <yanglu72@huawei.com> - 1.2.6-2
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:modify the getaddr method of ip
* Fri Dec 03 2021 quanhongfei <quanhongfei@huawei.com> - 1.2.6-1
- Type:requirements
- Id:NA