mirror of
https://github.com/ipxe/ipxe
synced 2025-12-12 23:15:10 +03:00
Change semantics of network API so that packet-absorbing calls *always*
take ownership of the packet, rather than doing so only if they return success. This breaks semantic compatibility with Linux's hard_start_xmit() method, but means that we don't have to worry so much about error cases. Split mechanism of processing received packets (net_rx_process()) out from policy (net_step()), preparatory to putting net_step() in a separate object.
This commit is contained in:
@@ -163,8 +163,7 @@ static int ipv4_rx ( struct pk_buff *pkb ) {
|
||||
pkb_empty ( pkb );
|
||||
pkb_put ( pkb, uip_len );
|
||||
memcpy ( pkb->data, uip_buf, uip_len );
|
||||
if ( net_transmit ( pkb ) != 0 )
|
||||
free_pkb ( pkb );
|
||||
net_transmit ( pkb );
|
||||
} else {
|
||||
free_pkb ( pkb );
|
||||
}
|
||||
@@ -231,7 +230,7 @@ struct net_protocol ipv4_protocol = {
|
||||
.name = "IP",
|
||||
.net_proto = htons ( ETH_P_IP ),
|
||||
.net_addr_len = sizeof ( struct in_addr ),
|
||||
.rx = ipv4_rx,
|
||||
.rx_process = ipv4_rx,
|
||||
.route = ipv4_route,
|
||||
.ntoa = ipv4_ntoa,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user