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:
Michael Brown
2006-04-29 17:17:43 +00:00
parent 23c494d14e
commit bac97eb979
4 changed files with 100 additions and 59 deletions

View File

@@ -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,
};