net/pkt: correct PF_PACKET family sending errors
Enable the pkt_sendmsg interface to send packets containing Layer 2 headers. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
parent
d0aa42c2ca
commit
3fa5466077
@ -106,13 +106,14 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
|
||||
/* Copy the packet data into the device packet buffer and send it */
|
||||
|
||||
int ret = devif_send(dev, pstate->snd_buffer,
|
||||
pstate->snd_buflen, 0);
|
||||
pstate->snd_buflen, -NET_LL_HDRLEN(dev));
|
||||
if (ret <= 0)
|
||||
{
|
||||
pstate->snd_sent = ret;
|
||||
goto end_wait;
|
||||
}
|
||||
|
||||
dev->d_len = dev->d_sndlen -= NET_LL_HDRLEN(dev);
|
||||
pstate->snd_sent = pstate->snd_buflen;
|
||||
|
||||
/* Make sure no ARP request overwrites this ARP request. This
|
||||
|
Loading…
Reference in New Issue
Block a user