diff --git a/src/net/IPv4Address.hxx b/src/net/IPv4Address.hxx index 58fa89897..07fb892ee 100644 --- a/src/net/IPv4Address.hxx +++ b/src/net/IPv4Address.hxx @@ -187,11 +187,18 @@ public: return address.sin_family != AF_UNSPEC; } + /** + * @return the port number in network byte order + */ + constexpr uint16_t GetPortBE() const noexcept { + return address.sin_port; + } + /** * @return the port number in host byte order */ constexpr uint16_t GetPort() const noexcept { - return FromBE16(address.sin_port); + return FromBE16(GetPortBE()); } /**