From 3e7e3f59b5add1de3af5623fbec88b882a38bea6 Mon Sep 17 00:00:00 2001 From: Aleksei Magusev Date: Sun, 3 Dec 2023 03:55:52 -0800 Subject: [PATCH] Drop support for OTP versions before 19 --- lib/statix/packet.ex | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/statix/packet.ex b/lib/statix/packet.ex index fd84ccf..2facf96 100644 --- a/lib/statix/packet.ex +++ b/lib/statix/packet.ex @@ -3,9 +3,6 @@ defmodule Statix.Packet do use Bitwise - otp_release = :erlang.system_info(:otp_release) - @addr_family if(otp_release >= '19', do: [1], else: []) - def header({n1, n2, n3, n4}, port) do true = Code.ensure_loaded?(:gen_udp) @@ -16,15 +13,15 @@ defmodule Statix.Packet do [] end - @addr_family ++ - [ - band(bsr(port, 8), 0xFF), - band(port, 0xFF), - band(n1, 0xFF), - band(n2, 0xFF), - band(n3, 0xFF), - band(n4, 0xFF) - ] ++ anc_data_part + [ + _addr_family = 1, + band(bsr(port, 8), 0xFF), + band(port, 0xFF), + band(n1, 0xFF), + band(n2, 0xFF), + band(n3, 0xFF), + band(n4, 0xFF) + ] ++ anc_data_part end def build(header, name, key, val, options) do