net: distribute udp packets according to address pair
This commit is contained in:
@@ -98,8 +98,9 @@ unsigned udp_v4::forward(packet& p, size_t off, ipv4_address from, ipv4_address
|
||||
}
|
||||
|
||||
auto dst = ntoh(uh->dst_port);
|
||||
auto src = ntoh(uh->src_port);
|
||||
|
||||
return dst % smp::count;
|
||||
return connid_hash()(connid{to, from, dst, src}) % smp::count;
|
||||
}
|
||||
|
||||
void udp_v4::received(packet p, ipv4_address from, ipv4_address to)
|
||||
|
||||
@@ -41,6 +41,9 @@ struct udp_channel_state {
|
||||
};
|
||||
|
||||
class udp_v4 : ip_protocol {
|
||||
using connid = l4connid<ipv4_traits>;
|
||||
using connid_hash = typename connid::connid_hash;
|
||||
|
||||
public:
|
||||
static const int default_queue_size;
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user