grub/grub-core/net
Stanislav Kholmanskikh 130234bc78 ofnet: implement the receive buffer
get_card_packet() from ofnet.c allocates a netbuff based on the device's MTU:

 nb = grub_netbuff_alloc (dev->mtu + 64 + 2);

In the case when the MTU is large, and the received packet is
relatively small, this leads to allocation of significantly more memory,
than it's required. An example could be transmission of TFTP packets
with 0x400 blksize via a network card with 0x10000 MTU.

This patch implements a per-card receive buffer in a way similar to efinet.c,
and makes get_card_packet() allocate a netbuff of the received data size.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2016-12-14 14:13:34 +01:00
..
drivers ofnet: implement the receive buffer 2016-12-14 14:13:34 +01:00
arp.c net: trivial grub_cpu_to_XX_compile_time cleanup 2015-03-27 18:58:57 +03:00
bootp.c bootp: export next server IP as environment variable 2016-11-22 20:43:04 +03:00
dns.c dns: fix buffer overflow for data->addresses in recv_hook 2016-07-26 20:38:58 +03:00
ethernet.c Add gcc_struct to all packed structures when compiling with mingw. 2013-12-15 14:14:30 +01:00
http.c http: reset EOF indication in http_seek 2016-04-30 09:13:34 +03:00
icmp.c arp, icmp: Fix handling in case of oversized or invalid packets. 2015-03-27 12:18:25 +01:00
icmp6.c net: fix ipv6 routing 2016-02-25 22:38:52 +03:00
ip.c net/ip: Fix limit_time calculation in freeing old fragments 2016-10-18 20:26:42 +03:00
net.c net: translate pxe prefix to tftp when checking for self-load 2016-05-03 19:23:31 +03:00
netbuff.c arp, icmp: Fix handling in case of oversized or invalid packets. 2015-03-27 12:18:25 +01:00
tcp.c tcp: fix memory leaks 2016-01-16 20:59:50 +03:00
tftp.c tftp: fix memory leaks in open 2016-01-16 21:27:57 +03:00
udp.c * grub-core/disk/ahci.c: Add needed explicit cast. 2013-08-21 21:02:14 +02:00