mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 13:05:27 +00:00
netdev: accept NULL in virNetDevSetupControl
Commit b9c6b073 dropped the version of virNetDevSetupControl that didn't check for NULL arguments, but we call it like that in virNetDevBridgeDelete.
This commit is contained in:
parent
3a3b8f6956
commit
695593fe00
@ -62,6 +62,7 @@ static int virNetDevSetupControlFull(const char *ifname,
|
|||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
|
if (ifr && ifname) {
|
||||||
memset(ifr, 0, sizeof(*ifr));
|
memset(ifr, 0, sizeof(*ifr));
|
||||||
|
|
||||||
if (virStrcpyStatic(ifr->ifr_name, ifname) == NULL) {
|
if (virStrcpyStatic(ifr->ifr_name, ifname) == NULL) {
|
||||||
@ -70,6 +71,7 @@ static int virNetDevSetupControlFull(const char *ifname,
|
|||||||
ifname);
|
ifname);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((fd = socket(domain, type, 0)) < 0) {
|
if ((fd = socket(domain, type, 0)) < 0) {
|
||||||
virReportSystemError(errno, "%s",
|
virReportSystemError(errno, "%s",
|
||||||
|
@ -38,7 +38,7 @@ typedef void virIfreq;
|
|||||||
|
|
||||||
int virNetDevSetupControl(const char *ifname,
|
int virNetDevSetupControl(const char *ifname,
|
||||||
virIfreq *ifr)
|
virIfreq *ifr)
|
||||||
ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
ATTRIBUTE_RETURN_CHECK;
|
||||||
|
|
||||||
int virNetDevExists(const char *brname)
|
int virNetDevExists(const char *brname)
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user