Errors generated by the network layer in response to received packets
are liable to be lost, since nothing systematically records these
errors and often the packets do not propagate far enough through the
stack to impact upon user-visible processes.
Improve this situation by recording network-layer errors in the
network device statistics.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
DBGC ( netdev, "NETDEV %p unknown network protocol %04x\n",
netdev, ntohs ( net_proto ) );
free_iob ( iobuf );
- return 0;
+ return -ENOTSUP;
}
/**
continue;
}
- net_rx ( iobuf, netdev, net_proto, ll_source );
+ /* Hand packet to network layer */
+ if ( ( rc = net_rx ( iob_disown ( iobuf ), netdev,
+ net_proto, ll_source ) ) != 0 ) {
+ /* Record error for diagnosis */
+ netdev_rx_err ( netdev, NULL, rc );
+ }
}
}
}