Skip to content

Commit 904834a

Browse files
Matan-Bavikivity
authored andcommitted
net/ip, net: sed -i 's/to_ulong/to_uint/'
boost::asio::ip::address_v4:to_ulong() was deprecated in 1.87 See boostorg/asio@60b8603 follow-up to: 11d1701 Signed-off-by: Matan Breizman <[email protected]>
1 parent 384661a commit 904834a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/net/ip.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ ipv4_address::ipv4_address(const std::string& addr) {
4646
throw std::runtime_error(
4747
fmt::format("Wrong format for IPv4 address {}. Please ensure it's in dotted-decimal format", addr));
4848
}
49-
ip = static_cast<uint32_t>(std::move(ipv4).to_ulong());
49+
ip = static_cast<uint32_t>(std::move(ipv4).to_uint());
5050
}
5151

5252
ipv4::ipv4(interface* netif)

src/net/net.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@ ipv4_addr::ipv4_addr(const std::string &addr) {
5757
std::vector<std::string> items;
5858
boost::split(items, addr, boost::is_any_of(":"));
5959
if (items.size() == 1) {
60-
ip = boost::asio::ip::make_address_v4(addr).to_ulong();
60+
ip = boost::asio::ip::make_address_v4(addr).to_uint();
6161
port = 0;
6262
} else if (items.size() == 2) {
63-
ip = boost::asio::ip::make_address_v4(items[0]).to_ulong();
63+
ip = boost::asio::ip::make_address_v4(items[0]).to_uint();
6464
port = std::stoul(items[1]);
6565
} else {
6666
throw std::invalid_argument("invalid format: " + addr);
6767
}
6868
}
6969

70-
ipv4_addr::ipv4_addr(const std::string &addr, uint16_t port_) : ip(boost::asio::ip::make_address_v4(addr).to_ulong()), port(port_) {}
70+
ipv4_addr::ipv4_addr(const std::string &addr, uint16_t port_) : ip(boost::asio::ip::make_address_v4(addr).to_uint()), port(port_) {}
7171

7272
ipv4_addr::ipv4_addr(const net::inet_address& a, uint16_t port)
7373
: ipv4_addr(::in_addr(a), port)

0 commit comments

Comments
 (0)