My network device don't work

Stan Drozd drozdziak1 at gmail.com
Tue Jun 20 09:31:29 EDT 2017


On Tue, Jun 20, 2017 at 02:32:31PM +0200, wiktoria.lewicka wrote:
> Hello.
> I write simple network device, but its don't work. Module is loading, loading, loading...
> Code:
> [...]
Hello,
"strncpy(my_netdev.name, DEV_NAME, 5)" only copies the 5 chars in "chwdp" without the null byte. You could bump it to 6
or maybe change 5 to IFNAMSIZ (the net_device.name's size) and then change the last byte to '\0' manually



More information about the Kernelnewbies mailing list