net/devif: Use the device ll header length to calculate send limit
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
parent
960b4bb2a7
commit
d295b4e1f1
@ -55,8 +55,7 @@
|
||||
void devif_can_send(FAR struct net_driver_s *dev, FAR const void *buf,
|
||||
unsigned int len)
|
||||
{
|
||||
unsigned int limit = NETDEV_PKTSIZE(dev) -
|
||||
CONFIG_NET_LL_GUARDSIZE;
|
||||
unsigned int limit = NETDEV_PKTSIZE(dev) - NET_LL_HDRLEN(dev);
|
||||
|
||||
if (dev == NULL || len == 0 || len > limit)
|
||||
{
|
||||
|
@ -55,8 +55,7 @@
|
||||
void devif_pkt_send(FAR struct net_driver_s *dev, FAR const void *buf,
|
||||
unsigned int len)
|
||||
{
|
||||
unsigned int limit = NETDEV_PKTSIZE(dev) -
|
||||
CONFIG_NET_LL_GUARDSIZE;
|
||||
unsigned int limit = NETDEV_PKTSIZE(dev) - NET_LL_HDRLEN(dev);
|
||||
|
||||
if (dev == NULL || len == 0 || len > limit)
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ void devif_send(FAR struct net_driver_s *dev, FAR const void *buf,
|
||||
int len, unsigned int offset)
|
||||
{
|
||||
unsigned int limit = NETDEV_PKTSIZE(dev) -
|
||||
CONFIG_NET_LL_GUARDSIZE - offset;
|
||||
NET_LL_HDRLEN(dev) - offset;
|
||||
|
||||
if (dev == NULL || len == 0 || len > limit)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user