From 03f0c23f8b1a60575f788dd1b9d4ea47debf2345 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 29 Aug 2012 23:34:14 +0100 Subject: [ipoib] Expose Ethernet-compatible eIPoIB link-layer addresses and headers Almost all clients of the raw-packet interfaces (UNDI and SNP) can handle only Ethernet link layers. Expose an Ethernet-compatible link layer to local clients, while remaining compatible with IPoIB on the wire. This requires manipulation of ARP (but not DHCP) packets within the IPoIB driver. This is ugly, but it's the only viable way to allow IPoIB devices to be driven via the raw-packet interfaces. Signed-off-by: Michael Brown --- src/interface/efi/efi_snp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/interface') diff --git a/src/interface/efi/efi_snp.c b/src/interface/efi/efi_snp.c index 88072aa6..6d7865dd 100644 --- a/src/interface/efi/efi_snp.c +++ b/src/interface/efi/efi_snp.c @@ -590,7 +590,8 @@ efi_snp_transmit ( EFI_SIMPLE_NETWORK_PROTOCOL *snp, /* Allocate buffer */ ll_headroom = ( MAX_LL_HEADER_LEN - ll_header_len ); - iobuf = alloc_iob ( ll_headroom + len ); + iobuf = alloc_iob ( ll_headroom + + ( ( len > IOB_ZLEN ) ? len : IOB_ZLEN ) ); if ( ! iobuf ) { DBGC ( snpdev, "SNPDEV %p TX could not allocate %ld-byte " "buffer\n", snpdev, ( ( unsigned long ) len ) ); -- cgit v1.2.3-55-g7522