tap: handle null namespace and bridge correctly 09/34209/2
authorMatthew Smith <mgsmith@netgate.com>
Fri, 22 Oct 2021 14:53:44 +0000 (09:53 -0500)
committerDamjan Marion <dmarion@me.com>
Thu, 28 Oct 2021 11:00:57 +0000 (11:00 +0000)
commit2b716b186fdfe0a40d6ddb9e43c795bb05d1ca10
tree95b03d9ddf0c57149b90aa71e418046bea42824a
parentc19ac303404966433096c4855a8192f746973522
tap: handle null namespace and bridge correctly

Type: fix

In tap_create_if(), if args->host_namespace or args->host_bridge are
null because no values were set for those, the virtio_if_t entry in
virtio_main.interfaces ends up getting populated with values of "(nil)"
in net_ns or host_bridge, respectively.

Check whether args->host_namespace and args->host_bridge are null before
trying to set the corresponding fields on virtio_if_t.

Change-Id: I8e1e66a6d7b246e7c66fece406d116ffb1312c64
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
src/vnet/devices/tap/tap.c