All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] openvswitch: Don't insert empty OVS_VPORT_ATTR_OPTIONS attribute
@ 2013-04-02 22:30 Thomas Graf
  2013-04-02 23:36 ` Jesse Gross
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Graf @ 2013-04-02 22:30 UTC (permalink / raw)
  To: jesse-l0M0P4e3n4LQT0dZR+AlfA
  Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA

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 <tgraf-G/eBtMaohhA@public.gmane.org>
---
 net/openvswitch/vport.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c
index f6b8132..71a2de8 100644
--- a/net/openvswitch/vport.c
+++ b/net/openvswitch/vport.c
@@ -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);
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] openvswitch: Don't insert empty OVS_VPORT_ATTR_OPTIONS attribute
  2013-04-02 22:30 [PATCH net-next] openvswitch: Don't insert empty OVS_VPORT_ATTR_OPTIONS attribute Thomas Graf
@ 2013-04-02 23:36 ` Jesse Gross
  0 siblings, 0 replies; 2+ messages in thread
From: Jesse Gross @ 2013-04-02 23:36 UTC (permalink / raw)
  To: Thomas Graf; +Cc: dev, netdev

On Tue, Apr 2, 2013 at 3:30 PM, Thomas Graf <tgraf@suug.ch> wrote:
> 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 <tgraf@suug.ch>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-02 23:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-02 22:30 [PATCH net-next] openvswitch: Don't insert empty OVS_VPORT_ATTR_OPTIONS attribute Thomas Graf
2013-04-02 23:36 ` Jesse Gross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.