]> git.proxmox.com Git - mirror_qemu.git/commit - net/slirp.c
net: check the existence of peer before trying to pad
authorJason Wang <jasowang@redhat.com>
Fri, 23 Apr 2021 03:18:03 +0000 (11:18 +0800)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 23 Apr 2021 10:11:28 +0000 (11:11 +0100)
commitbc38e31b4e0366f3a70c0939abde4c3dd6e0fa30
treef8e330e2edb9005a327170cffa51cd0944673806
parentb1cffefa1b163bce9aebc3416f562c1d3886eeaa
net: check the existence of peer before trying to pad

There could be case that peer is NULL. This can happen when during
network device hot-add where net device needs to be added first. So
the patch check the existence of peer before trying to do the pad.

Fixes: 969e50b61a285 ("net: Pad short frames to minimum size before sending from SLiRP/TAP")
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Message-id: 20210423031803.1479-1-jasowang@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
include/net/net.h
net/slirp.c
net/tap-win32.c
net/tap.c