summaryrefslogtreecommitdiffstats
path: root/src/net/ethernet.c
diff options
context:
space:
mode:
authorMichael Brown2012-03-02 19:02:03 +0100
committerMichael Brown2012-03-02 19:02:03 +0100
commit6324bd9389521c7e86384591f41eb78a81e9af47 (patch)
tree2047727059c7c2daf309bc00002571c3a20de1e9 /src/net/ethernet.c
parent[iscsi] Send any padding inline with the data segment (diff)
downloadipxe-6324bd9389521c7e86384591f41eb78a81e9af47.tar.gz
ipxe-6324bd9389521c7e86384591f41eb78a81e9af47.tar.xz
ipxe-6324bd9389521c7e86384591f41eb78a81e9af47.zip
[undi] Allow underlying PXE stack to construct link-layer header
Some PXE stacks (observed with a QLogic 8242) will always try to prepend a link-layer header, even if the caller uses P_UNKNOWN to indicate that the link-layer header has already been filled in. This results in an invalid packet being transmitted. Work around these faulty PXE stacks where possible by stripping the existing link-layer header and allowing the PXE stack to (re)construct the link-layer header itself. Originally-fixed-by: Buck Huppmann <buckh@pobox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/ethernet.c')
-rw-r--r--src/net/ethernet.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/net/ethernet.c b/src/net/ethernet.c
index c63fd9bc..a842bc11 100644
--- a/src/net/ethernet.c
+++ b/src/net/ethernet.c
@@ -50,9 +50,9 @@ static uint8_t eth_broadcast[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
* @v net_proto Network-layer protocol, in network-byte order
* @ret rc Return status code
*/
-static int eth_push ( struct net_device *netdev __unused,
- struct io_buffer *iobuf, const void *ll_dest,
- const void *ll_source, uint16_t net_proto ) {
+int eth_push ( struct net_device *netdev __unused, struct io_buffer *iobuf,
+ const void *ll_dest, const void *ll_source,
+ uint16_t net_proto ) {
struct ethhdr *ethhdr = iob_push ( iobuf, sizeof ( *ethhdr ) );
/* Build Ethernet header */
@@ -74,10 +74,9 @@ static int eth_push ( struct net_device *netdev __unused,
* @ret flags Packet flags
* @ret rc Return status code
*/
-static int eth_pull ( struct net_device *netdev __unused,
- struct io_buffer *iobuf, const void **ll_dest,
- const void **ll_source, uint16_t *net_proto,
- unsigned int *flags ) {
+int eth_pull ( struct net_device *netdev __unused, struct io_buffer *iobuf,
+ const void **ll_dest, const void **ll_source,
+ uint16_t *net_proto, unsigned int *flags ) {
struct ethhdr *ethhdr = iobuf->data;
/* Sanity check */