mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
Kernel: Outbound packets should use the source address from the socket
Previously we'd use the adapter's address as the source address when sending packets. Instead we should use the socket's bound local address.
This commit is contained in:
committed by
Andreas Kling
parent
532db9f768
commit
2b6aa571d1
@@ -206,7 +206,8 @@ KResultOr<size_t> IPv4Socket::sendto(FileDescription&, const UserOrKernelBuffer&
|
||||
dbgln_if(IPV4_SOCKET_DEBUG, "sendto: destination={}:{}", m_peer_address, m_peer_port);
|
||||
|
||||
if (type() == SOCK_RAW) {
|
||||
auto result = routing_decision.adapter->send_ipv4(routing_decision.next_hop, m_peer_address, (IPv4Protocol)protocol(), data, data_length, m_ttl);
|
||||
auto result = routing_decision.adapter->send_ipv4(local_address(), routing_decision.next_hop,
|
||||
m_peer_address, (IPv4Protocol)protocol(), data, data_length, m_ttl);
|
||||
if (result.is_error())
|
||||
return result;
|
||||
return data_length;
|
||||
|
||||
Reference in New Issue
Block a user