mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 22:58:16 +02:00
core/ovs: fix setting dpdk-devargs JSON to NULL
NMSettingOvsDpdk does not have a verify() implementation that would prevent
the devargs property from being NULL. We must thus anticipate and handle
a NULL value.
Fixes: ae4152120a ('ovs/ovsdb: add support for setting dpdk devargs option')
This commit is contained in:
parent
daba069eab
commit
d6395f7ee7
1 changed files with 6 additions and 3 deletions
|
|
@ -753,6 +753,7 @@ _insert_interface(json_t *params,
|
||||||
NMSettingOvsInterface *s_ovs_iface;
|
NMSettingOvsInterface *s_ovs_iface;
|
||||||
NMSettingOvsDpdk *s_ovs_dpdk;
|
NMSettingOvsDpdk *s_ovs_dpdk;
|
||||||
NMSettingOvsPatch *s_ovs_patch;
|
NMSettingOvsPatch *s_ovs_patch;
|
||||||
|
char *dpdk_devargs;
|
||||||
json_t *options = json_array();
|
json_t *options = json_array();
|
||||||
json_t *row;
|
json_t *row;
|
||||||
guint32 mtu = 0;
|
guint32 mtu = 0;
|
||||||
|
|
@ -777,9 +778,11 @@ _insert_interface(json_t *params,
|
||||||
s_ovs_patch = nm_connection_get_setting_ovs_patch(interface);
|
s_ovs_patch = nm_connection_get_setting_ovs_patch(interface);
|
||||||
|
|
||||||
if (s_ovs_dpdk) {
|
if (s_ovs_dpdk) {
|
||||||
json_array_append_new(
|
dpdk_devargs = nm_setting_ovs_dpdk_get_devargs(s_ovs_dpdk);
|
||||||
options,
|
if (dpdk_devargs)
|
||||||
json_pack("[[s, s]]", "dpdk-devargs", nm_setting_ovs_dpdk_get_devargs(s_ovs_dpdk)));
|
json_array_append_new(options, json_pack("[[s, s]]", "dpdk-devargs", dpdk_devargs));
|
||||||
|
else
|
||||||
|
json_array_append_new(options, json_array());
|
||||||
} else if (s_ovs_patch) {
|
} else if (s_ovs_patch) {
|
||||||
json_array_append_new(
|
json_array_append_new(
|
||||||
options,
|
options,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue