sim_netdriver: some sim defconfig have problems when using the network
if the configured SIM_NETDEV_BUFSIZE < host MTU, there will be issues with access out of bounds Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
parent
3a9c193bf7
commit
7c322c250a
|
@ -280,7 +280,8 @@ void sim_netdriver_setmacaddr(int devidx, unsigned char *macaddr)
|
||||||
|
|
||||||
void sim_netdriver_setmtu(int devidx, int mtu)
|
void sim_netdriver_setmtu(int devidx, int mtu)
|
||||||
{
|
{
|
||||||
g_sim_dev[devidx].dev.netdev.d_pktsize = mtu + ETH_HDRLEN;
|
g_sim_dev[devidx].dev.netdev.d_pktsize = MIN(SIM_NETDEV_BUFSIZE,
|
||||||
|
mtu + ETH_HDRLEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sim_netdriver_loop(void)
|
void sim_netdriver_loop(void)
|
||||||
|
|
Loading…
Reference in New Issue