net/devif: devif_send supports negative offset
To enable the pkt_sendmsg interface to send packets containing L2 headers Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
parent
4245da43ca
commit
d0aa42c2ca
@ -465,7 +465,7 @@ uint16_t devif_dev_event(FAR struct net_driver_s *dev, uint16_t flags);
|
||||
****************************************************************************/
|
||||
|
||||
int devif_send(FAR struct net_driver_s *dev, FAR const void *buf,
|
||||
int len, unsigned int offset);
|
||||
int len, int offset);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: devif_iob_send
|
||||
|
@ -67,7 +67,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
int devif_send(FAR struct net_driver_s *dev, FAR const void *buf,
|
||||
int len, unsigned int offset)
|
||||
int len, int offset)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -102,7 +102,7 @@ int devif_send(FAR struct net_driver_s *dev, FAR const void *buf,
|
||||
|
||||
/* Prepare device buffer before poll callback */
|
||||
|
||||
iob_update_pktlen(dev->d_iob, offset, false);
|
||||
iob_update_pktlen(dev->d_iob, offset < 0 ? 0 : offset, false);
|
||||
|
||||
ret = iob_trycopyin(dev->d_iob, buf, len, offset, false);
|
||||
if (ret != len)
|
||||
|
Loading…
Reference in New Issue
Block a user