From 8c4232ca961839ce4e59ae306456f30e91c97a51 Mon Sep 17 00:00:00 2001 From: gisellevonbingen Date: Wed, 9 Aug 2023 15:42:29 +0900 Subject: [PATCH] MapToIPv4 before IPAddress convert to int --- Giselle.Net.EtherNetIP/IPAddressUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Giselle.Net.EtherNetIP/IPAddressUtils.cs b/Giselle.Net.EtherNetIP/IPAddressUtils.cs index 0e876e9..f33e7b4 100644 --- a/Giselle.Net.EtherNetIP/IPAddressUtils.cs +++ b/Giselle.Net.EtherNetIP/IPAddressUtils.cs @@ -38,7 +38,7 @@ public static IPAddress ToIPv4Address(this int address, bool isBigEndian = true) public static int ToIPv4Address(this IPAddress address, bool isBigEndian = true) { - var bytes = address.GetAddressBytes(); + var bytes = address.MapToIPv4().GetAddressBytes(); int value = 0; if (isBigEndian == true)