Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Strip a trailing . when present in name - #4348 #4614

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cscherban
Copy link

This is a very poor attempt at addressing the issue mentioned here: #4348, which is caused by openssl/openssl#11560 (comment)

If this is the wrong place to be attempting to address the issue, I would love guidance on how to properly tackle the problem. I don't use librdkafka directly, but rely on a ruby wrapping library. (karafka).

What I'm attempting here is to transform
my.kafka.domain.com.:9093 -> my.kafka.domain.com:9093
by splitting on ":" and replacing trailing "." with "\0"

@cscherban cscherban changed the title [WIP] Strip a trailing . when present in name - Address confluentinc/librdkafka#4348 [WIP] Strip a trailing . when present in name - #4348 Feb 8, 2024
Copy link

cla-assistant bot commented Feb 8, 2024

CLA assistant check
All committers have signed the CLA.

@Quuxplusone
Copy link
Contributor

No comment on the desirability of this patch (versus waiting for OpenSSL to fix it, or discovering that it's not really a bug after all) — but unless I'm mistaken, the :9093 part has already been stripped by line 452, and any : characters that remain are part of an IPv6 address. So probably all you want here is:

         /* Remove ":9092" port suffix from nodename */
         if ((t = strrchr(name, ':')))
                 *t = '\0';
+
+        /* Remove "." trailing dot suffix from nodename */
+        if ((t = strrchr(name, '.')) && t[1] == '\0')
+                *t = '\0';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants