Commit 5d963352 authored by Thomas Graf's avatar Thomas Graf Committed by Jesse Gross

openvswitch: Don't insert empty OVS_VPORT_ATTR_OPTIONS attribute

The port specific options are currently unused resulting in an
empty OVS_VPORT_ATTR_OPTIONS nested attribute being inserted
into every OVS_VPORT_CMD_GET message.

Don't insert OVS_VPORT_ATTR_OPTIONS if no options are present.
Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarJesse Gross <jesse@nicira.com>
parent 22e3880a
...@@ -301,18 +301,20 @@ void ovs_vport_get_stats(struct vport *vport, struct ovs_vport_stats *stats) ...@@ -301,18 +301,20 @@ void ovs_vport_get_stats(struct vport *vport, struct ovs_vport_stats *stats)
int ovs_vport_get_options(const struct vport *vport, struct sk_buff *skb) int ovs_vport_get_options(const struct vport *vport, struct sk_buff *skb)
{ {
struct nlattr *nla; struct nlattr *nla;
int err;
if (!vport->ops->get_options)
return 0;
nla = nla_nest_start(skb, OVS_VPORT_ATTR_OPTIONS); nla = nla_nest_start(skb, OVS_VPORT_ATTR_OPTIONS);
if (!nla) if (!nla)
return -EMSGSIZE; return -EMSGSIZE;
if (vport->ops->get_options) { err = vport->ops->get_options(vport, skb);
int err = vport->ops->get_options(vport, skb);
if (err) { if (err) {
nla_nest_cancel(skb, nla); nla_nest_cancel(skb, nla);
return err; return err;
} }
}
nla_nest_end(skb, nla); nla_nest_end(skb, nla);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment