-
-
Notifications
You must be signed in to change notification settings - Fork 1
Handle IPv6-only results even in GETHOSTBYNAME #1
Conversation
Previously IPv6-only results would return an empty successful result message. This doesn't seem to be a valid response from the perspective of Glibc. In my case it caused Firefox to crash.
Not sure I follow. The previous code did return an error if We did filter out all addresses that are not IPv4 from the |
I can confirm that switching to nsncd causes firefox to crash in scenarios like this. This PR appears to fix it. I applied it via: inputs.nsncd = {
url = "github:andir/nsncd/fix-ipv6";
flake = false;
};
outputs = { self, nixpkgs, nsncd, ... }: {
nixosConfigurations.hermes-conrad = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
({
nixpkgs.overlays = [
(self: super: {
nsncd = super.nsncd.overrideAttrs (_: {
src = nsncd;
});
})
];
})
...
|
It looks to me like the change is making it return Ok(None) if there are no IPv4 addresses, and that returning an Ok(Some(...)) with an empty list is causing firefox to crash. It may be that Vec1 would be a better return type: https://crates.io/crates/vec1/1.0.0 |
I fixed that in andir@16bee69 which is in another branch with tons of refactorings. Instead of requiring a Vec1 I made it so that the code is safe to use with an empty list. |
@andir can you cherry-pick the fixes into this PR here, and maybe improve some of the commit messages, if things are still unclear? Happy to also merge the refactoring a, but that should probably be a separate PR :-) |
Alright, I'm gonna merge this and cherry-pick some of the fixes too. Thanks for the PR! |
This bump fixes the response format for IPV6-only requests. The bogus response message was crashing glibc. See nix-community/nsncd#1 for more informations.
This bump fixes the response format for IPV6-only requests. The bogus response message was crashing glibc. See nix-community/nsncd#1 for more informations.
This bump fixes the response format for IPV6-only requests. The bogus response message was crashing glibc. See nix-community/nsncd#1 for more informations.
Previously IPv6-only results would return an empty successful result
message. This doesn't seem to be a valid response from the perspective
of Glibc. In my case it caused Firefox to crash.