diff options
Diffstat (limited to 'arch/sandbox')
-rw-r--r-- | arch/sandbox/cpu/eth-raw-os.c | 4 | ||||
-rw-r--r-- | arch/sandbox/dts/test.dts | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/arch/sandbox/cpu/eth-raw-os.c b/arch/sandbox/cpu/eth-raw-os.c index b76a7319ae..528865f5d3 100644 --- a/arch/sandbox/cpu/eth-raw-os.c +++ b/arch/sandbox/cpu/eth-raw-os.c @@ -76,6 +76,10 @@ static int _raw_packet_start(const char *ifname, unsigned char *ethmac, printf("Failed to set promiscuous mode: %d %s\n" "Falling back to the old \"flags\" way...\n", errno, strerror(errno)); + if (strlen(ifname) >= IFNAMSIZ) { + printf("Interface name %s is too long.\n", ifname); + return -EINVAL; + } strncpy(ifr.ifr_name, ifname, IFNAMSIZ); if (ioctl(priv->sd, SIOCGIFFLAGS, &ifr) < 0) { printf("Failed to read flags: %d %s\n", errno, diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index b6d9a15da4..2e0d320b1e 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -279,6 +279,11 @@ 0x38 8>; }; + timer { + compatible = "sandbox,timer"; + clock-frequency = <1000000>; + }; + uart0: serial { compatible = "sandbox,serial"; u-boot,dm-pre-reloc; |