mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 22:15:20 +00:00
Eliminate compile warnings in nwfilter error log calls
This commit is contained in:
parent
d62f4c36c2
commit
78151ec96e
@ -156,13 +156,13 @@ printDataType(virConnectPtr conn,
|
|||||||
case DATATYPE_IPADDR:
|
case DATATYPE_IPADDR:
|
||||||
data = virSocketFormatAddr(&item->u.ipaddr.addr);
|
data = virSocketFormatAddr(&item->u.ipaddr.addr);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
virNWFilterReportError(conn, VIR_ERR_INTERNAL_ERROR,
|
virNWFilterReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("internal IPv4 address representation "
|
_("internal IPv4 address representation "
|
||||||
"is bad"));
|
"is bad"));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (snprintf(buf, bufsize, "%s", data) >= bufsize) {
|
if (snprintf(buf, bufsize, "%s", data) >= bufsize) {
|
||||||
virNWFilterReportError(conn, VIR_ERR_INTERNAL_ERROR,
|
virNWFilterReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("buffer too small for IP address"));
|
_("buffer too small for IP address"));
|
||||||
VIR_FREE(data);
|
VIR_FREE(data);
|
||||||
return 1;
|
return 1;
|
||||||
@ -173,14 +173,14 @@ printDataType(virConnectPtr conn,
|
|||||||
case DATATYPE_IPV6ADDR:
|
case DATATYPE_IPV6ADDR:
|
||||||
data = virSocketFormatAddr(&item->u.ipaddr.addr);
|
data = virSocketFormatAddr(&item->u.ipaddr.addr);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
virNWFilterReportError(conn, VIR_ERR_INTERNAL_ERROR,
|
virNWFilterReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("internal IPv6 address representation "
|
_("internal IPv6 address representation "
|
||||||
"is bad"));
|
"is bad"));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (snprintf(buf, bufsize, "%s", data) >= bufsize) {
|
if (snprintf(buf, bufsize, "%s", data) >= bufsize) {
|
||||||
virNWFilterReportError(conn, VIR_ERR_INTERNAL_ERROR,
|
virNWFilterReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("buffer too small for IPv6 address"));
|
_("buffer too small for IPv6 address"));
|
||||||
VIR_FREE(data);
|
VIR_FREE(data);
|
||||||
return 1;
|
return 1;
|
||||||
@ -191,7 +191,7 @@ printDataType(virConnectPtr conn,
|
|||||||
case DATATYPE_MACADDR:
|
case DATATYPE_MACADDR:
|
||||||
case DATATYPE_MACMASK:
|
case DATATYPE_MACMASK:
|
||||||
if (bufsize < VIR_MAC_STRING_BUFLEN) {
|
if (bufsize < VIR_MAC_STRING_BUFLEN) {
|
||||||
virNWFilterReportError(conn, VIR_ERR_INVALID_NWFILTER,
|
virNWFilterReportError(conn, VIR_ERR_INVALID_NWFILTER, "%s",
|
||||||
_("Buffer too small for MAC address"));
|
_("Buffer too small for MAC address"));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -202,7 +202,7 @@ printDataType(virConnectPtr conn,
|
|||||||
case DATATYPE_UINT16:
|
case DATATYPE_UINT16:
|
||||||
if (snprintf(buf, bufsize, "%d",
|
if (snprintf(buf, bufsize, "%d",
|
||||||
item->u.u16) >= bufsize) {
|
item->u.u16) >= bufsize) {
|
||||||
virNWFilterReportError(conn, VIR_ERR_INVALID_NWFILTER,
|
virNWFilterReportError(conn, VIR_ERR_INVALID_NWFILTER, "%s",
|
||||||
_("Buffer too small for uint16 type"));
|
_("Buffer too small for uint16 type"));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -213,7 +213,7 @@ printDataType(virConnectPtr conn,
|
|||||||
case DATATYPE_UINT8:
|
case DATATYPE_UINT8:
|
||||||
if (snprintf(buf, bufsize, "%d",
|
if (snprintf(buf, bufsize, "%d",
|
||||||
item->u.u8) >= bufsize) {
|
item->u.u8) >= bufsize) {
|
||||||
virNWFilterReportError(conn, VIR_ERR_INVALID_NWFILTER,
|
virNWFilterReportError(conn, VIR_ERR_INVALID_NWFILTER, "%s",
|
||||||
_("Buffer too small for uint8 type"));
|
_("Buffer too small for uint8 type"));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user