diff --git a/net/ip.hh b/net/ip.hh index 3c8c139f1b..75f02b7d44 100644 --- a/net/ip.hh +++ b/net/ip.hh @@ -368,7 +368,7 @@ public: tcp& get_tcp() { return *_tcp._tcp; } ipv4_udp& get_udp() { return _udp; } void register_l4(proto_type id, ip_protocol* handler); - net::hw_features hw_features() { return _netif->hw_features(); } + const net::hw_features& hw_features() const { return _netif->hw_features(); } static bool needs_frag(packet& p, ip_protocol_num proto_num, net::hw_features hw_features); void learn(ethernet_address l2, ipv4_address l3) { _arp.learn(l2, l3); diff --git a/net/net.hh b/net/net.hh index db7c954073..96cf20ff7b 100644 --- a/net/net.hh +++ b/net/net.hh @@ -119,7 +119,7 @@ private: public: explicit interface(std::shared_ptr dev); ethernet_address hw_address() { return _hw_address; } - net::hw_features hw_features() { return _hw_features; } + const net::hw_features& hw_features() const { return _hw_features; } subscription register_l3(eth_protocol_num proto_num, std::function (packet p, ethernet_address from)> next, std::function forward); diff --git a/net/tcp.hh b/net/tcp.hh index 91c0b9e061..648846a0cc 100644 --- a/net/tcp.hh +++ b/net/tcp.hh @@ -591,7 +591,7 @@ public: bool forward(forward_hash& out_hash_data, packet& p, size_t off); listener listen(uint16_t port, size_t queue_length = 100); future connect(socket_address sa); - net::hw_features hw_features() { return _inet._inet.hw_features(); } + const net::hw_features& hw_features() const { return _inet._inet.hw_features(); } future<> poll_tcb(ipaddr to, lw_shared_ptr tcb); private: void send_packet_without_tcb(ipaddr from, ipaddr to, packet p);