diff --git a/repos/os/include/net/dhcp.h b/repos/os/include/net/dhcp.h index 6429ebb2f8..7dcef7a6e6 100644 --- a/repos/os/include/net/dhcp.h +++ b/repos/os/include/net/dhcp.h @@ -199,7 +199,7 @@ class Net::Dhcp_packet { static constexpr Code CODE = Code::PARAM_REQ_LIST; - Parameter_request_list(Genode::size_t len) : Option(CODE, len) { } + Parameter_request_list(Genode::size_t len) : Option(CODE, (Genode::uint8_t)len) { } }; /** @@ -215,7 +215,7 @@ class Net::Dhcp_packet static constexpr Code CODE = Code::DNS_SERVER; - Dns_server(Genode::size_t len) : Option(CODE, len) { } + Dns_server(Genode::size_t len) : Option(CODE, (Genode::uint8_t)len) { } template void for_each_address(FUNC && func) const @@ -241,7 +241,7 @@ class Net::Dhcp_packet static constexpr Code CODE = Code::DOMAIN_NAME; - Domain_name (Genode::size_t len) : Option(CODE, len) { } + Domain_name (Genode::size_t len) : Option(CODE, (Genode::uint8_t)len) { } template void with_string(FUNC && func) const diff --git a/repos/os/include/net/ipv4.h b/repos/os/include/net/ipv4.h index e819a074c2..f2f12dd752 100644 --- a/repos/os/include/net/ipv4.h +++ b/repos/os/include/net/ipv4.h @@ -187,7 +187,7 @@ class Net::Ipv4_packet Ipv4_address src() const { return Ipv4_address((void *)&_src); } Ipv4_address dst() const { return Ipv4_address((void *)&_dst); } - void header_length(Genode::size_t v) { Offset_0_u8::Ihl::set(_offset_0_u8, v); } + void header_length(Genode::size_t v) { Offset_0_u8::Ihl::set(_offset_0_u8, (Offset_0_u8::access_t)v); } void version(Genode::uint8_t v) { Offset_0_u8::Version::set(_offset_0_u8, v); } void diff_service(Genode::uint8_t v) { Offset_1_u8::Dscp::set(_offset_1_u8, v); } void ecn(Genode::uint8_t v) { Offset_1_u8::Ecn::set(_offset_1_u8, v); } @@ -209,7 +209,7 @@ class Net::Ipv4_packet void fragment_offset(Genode::size_t v) { Genode::uint16_t be = host_to_big_endian(_offset_6_u16); - Offset_6_u16::Fragment_offset::set(be, v); + Offset_6_u16::Fragment_offset::set(be, (Offset_6_u16::access_t)v); _offset_6_u16 = host_to_big_endian(be); } diff --git a/repos/os/include/net/port.h b/repos/os/include/net/port.h index 33ff853ad1..91b5ad17c9 100644 --- a/repos/os/include/net/port.h +++ b/repos/os/include/net/port.h @@ -50,7 +50,7 @@ Genode::size_t Net::ascii_to(const char *s, Net::Port &result) { using namespace Genode; - unsigned value = 0; + uint16_t value = 0; size_t const consumed = ascii_to_unsigned(s, value, 0); result = Net::Port(value); return consumed;