mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
net/ptpd: fix compile warning issue
In some scenarios, dynamic memory allocation is not allowed, so it is modified to a static allocation method. Signed-off-by: gaohedong <gaohedong@xiaomi.com>
This commit is contained in:
parent
e804886c68
commit
54bef649ea
1 changed files with 3 additions and 1 deletions
|
|
@ -758,11 +758,13 @@ static int ptp_sendmsg(FAR struct ptp_state_s *state, FAR const void *buf,
|
|||
0x01, 0x80, 0xc2, 0x00, 0x00, 0x0e
|
||||
};
|
||||
|
||||
char raw[sizeof(struct ether_header) + buflen];
|
||||
char raw[sizeof(struct ether_header) + sizeof(struct ptp_announce_s)];
|
||||
FAR struct ether_header *header;
|
||||
struct msghdr msg;
|
||||
struct iovec iov;
|
||||
|
||||
DEBUGASSERT(sizeof(struct ptp_announce_s) >= buflen);
|
||||
|
||||
header = (FAR struct ether_header *)&raw;
|
||||
memcpy(header->ether_dhost, ptp_multicast_mac, ETHER_ADDR_LEN);
|
||||
netlib_getmacaddr(state->config->interface, header->ether_shost);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue