Skip to content

Commit

Permalink
openvswitch: Don't insert empty OVS_VPORT_ATTR_OPTIONS attribute
Browse files Browse the repository at this point in the history
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: Thomas Graf <[email protected]>
Signed-off-by: Jesse Gross <[email protected]>
  • Loading branch information
tgraf authored and jessegross committed Apr 2, 2013
1 parent 22e3880 commit 5d96335
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions net/openvswitch/vport.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,17 +301,19 @@ 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)
{
struct nlattr *nla;
int err;

if (!vport->ops->get_options)
return 0;

nla = nla_nest_start(skb, OVS_VPORT_ATTR_OPTIONS);
if (!nla)
return -EMSGSIZE;

if (vport->ops->get_options) {
int err = vport->ops->get_options(vport, skb);
if (err) {
nla_nest_cancel(skb, nla);
return err;
}
err = vport->ops->get_options(vport, skb);
if (err) {
nla_nest_cancel(skb, nla);
return err;
}

nla_nest_end(skb, nla);
Expand Down

0 comments on commit 5d96335

Please sign in to comment.