diff options
author | Michael Brown <mcb30@ipxe.org> | 2012-03-02 18:02:03 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2012-03-02 18:02:03 +0000 |
commit | 6324bd9389521c7e86384591f41eb78a81e9af47 (patch) | |
tree | 2047727059c7c2daf309bc00002571c3a20de1e9 /src/net/ethernet.c | |
parent | 1d293776ea290ae1f4d1228f3278030facf97a4b (diff) | |
download | ipxe-6324bd9389521c7e86384591f41eb78a81e9af47.tar.gz |
[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.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/net/ethernet.c b/src/net/ethernet.c index c63fd9bc3..a842bc117 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 */ |