From 5cf65528f2339a2ae14be4179ddc44784cc8e7d4 Mon Sep 17 00:00:00 2001 From: Leah Ulmschneider Date: Wed, 1 Oct 2025 19:09:56 +0200 Subject: [PATCH] Fix decoding inet with netmask --- src/pg_inet.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pg_inet.erl b/src/pg_inet.erl index 7a14743..99ff3b6 100644 --- a/src/pg_inet.erl +++ b/src/pg_inet.erl @@ -39,7 +39,11 @@ decode(<>, _) -> decode(<>, _) -> list_to_tuple(binary_to_list(Bin)); decode(<>, _) -> - list_to_tuple([X || <> <= Bin]). + list_to_tuple([X || <> <= Bin]); +decode(<>, _) -> + {list_to_tuple(binary_to_list(Bin)), Mask}; +decode(<>, _) -> + {list_to_tuple([X || <> <= Bin]), Mask}. type_spec() -> "{0..255, 0..255, 0..255, 0..255} | "