]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
stand: dev_net: correct net_open's interpretation of params
authorkevans <kevans@FreeBSD.org>
Fri, 15 Feb 2019 18:28:51 +0000 (18:28 +0000)
committerkevans <kevans@FreeBSD.org>
Fri, 15 Feb 2019 18:28:51 +0000 (18:28 +0000)
commit3e89fd24ea6c3c61a322ff0040f5583eed6597fc
tree677704487a8b99423d43693c716baf30d07abd27
parent445ce42f8be9ebc3c1be1e430e80aaa326e247e9
stand: dev_net: correct net_open's interpretation of params

net_open previously casted the first vararg to a char * and this was
half-OK: at first, it is passed to netif_open, which would cast it back to
the struct devdesc * that it really is and use it properly. It is then
strdup()d and used as the netdev_name, which is objectively wrong.

Correct it so that the first vararg is properly casted to a struct devdesc *
and the netdev_name gets set properly to make it more clear at a glance that
it's not doing something horribly wrong.

Reported by: mmel
Reviewed by: imp, mmel, tsoome
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19206
stand/common/dev_net.c