summaryrefslogtreecommitdiff
path: root/0224-core-replace-inet_addr-with-inet_pton.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-01 14:35:16 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-01 14:35:16 +0000
commit2453fd874197f84e11ae70053cff7f56a32988f4 (patch)
treed6ce5f0f1defa8b7a9b070ba870a8b7f916578dc /0224-core-replace-inet_addr-with-inet_pton.patch
parente47cbe682033e9df1530280ef7460c172c32961a (diff)
automatic import of glusterfsopeneuler24.03_LTS
Diffstat (limited to '0224-core-replace-inet_addr-with-inet_pton.patch')
-rw-r--r--0224-core-replace-inet_addr-with-inet_pton.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/0224-core-replace-inet_addr-with-inet_pton.patch b/0224-core-replace-inet_addr-with-inet_pton.patch
new file mode 100644
index 0000000..f9a3b56
--- /dev/null
+++ b/0224-core-replace-inet_addr-with-inet_pton.patch
@@ -0,0 +1,53 @@
+From 3528c4fb59ca4d3efda2cf0689b7549e449bb91b Mon Sep 17 00:00:00 2001
+From: Rinku Kothiya <rkothiya@redhat.com>
+Date: Fri, 14 Jun 2019 07:53:06 +0000
+Subject: [PATCH 224/255] core: replace inet_addr with inet_pton
+
+Fixes warning raised by RPMDiff on the use of inet_addr, which may
+impact Ipv6 support
+
+> upstream patch : https://review.gluster.org/#/c/glusterfs/+/22866/
+
+>fixes: bz#1721385
+>Change-Id: Id2d9afa1747efa64bc79d90dd2566bff54deedeb
+>Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
+
+BUG: 1698435
+Change-Id: Id2d9afa1747efa64bc79d90dd2566bff54deedeb
+Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
+Reviewed-on: https://code.engineering.redhat.com/gerrit/175318
+Tested-by: RHGS Build Bot <nigelb@redhat.com>
+Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
+---
+ libglusterfs/src/events.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/libglusterfs/src/events.c b/libglusterfs/src/events.c
+index 9b3a226..2509767 100644
+--- a/libglusterfs/src/events.c
++++ b/libglusterfs/src/events.c
+@@ -41,6 +41,7 @@ _gf_event(eventtypes_t event, const char *fmt, ...)
+ char *host = NULL;
+ struct addrinfo hints;
+ struct addrinfo *result = NULL;
++ xlator_t *this = THIS;
+
+ /* Global context */
+ ctx = THIS->ctx;
+@@ -82,7 +83,12 @@ _gf_event(eventtypes_t event, const char *fmt, ...)
+ /* Socket Configurations */
+ server.sin_family = AF_INET;
+ server.sin_port = htons(EVENT_PORT);
+- server.sin_addr.s_addr = inet_addr(host);
++ ret = inet_pton(server.sin_family, host, &server.sin_addr);
++ if (ret <= 0) {
++ gf_msg(this->name, GF_LOG_ERROR, EINVAL, LG_MSG_INVALID_ARG,
++ "inet_pton failed with return code %d", ret);
++ goto out;
++ }
+ memset(&server.sin_zero, '\0', sizeof(server.sin_zero));
+
+ va_start(arguments, fmt);
+--
+1.8.3.1
+