[ovs-git] [openvswitch/ovs] 667bb1: ofp-util: Make decoding switch features harder to ...

GitHub noreply at github.com
Thu Jan 21 05:54:18 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 667bb1fbf97774cc0627eeca9972c4f8d219fe54
      https://github.com/openvswitch/ovs/commit/667bb1fbf97774cc0627eeca9972c4f8d219fe54
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2016-01-20 (Wed, 20 Jan 2016)

  Changed paths:
    M lib/learning-switch.c
    M lib/ofp-print.c
    M lib/ofp-util.c
    M lib/ofp-util.h
    M utilities/ovs-ofctl.c

  Log Message:
  -----------
  ofp-util: Make decoding switch features harder to misuse (and fix leak).

Until now, ofputil_decode_switch_features() has put the ports from the
switch features message into a separate ofpbuf supplied as an argument.
The natural desire for a caller is to just reuse an ofpbuf that it already
has, and that's what one of the callers did.  This however has the
nonobvious effect of leaking the memory that the ofpbuf previously owned,
since it gets replaced by an OFPBUF_CONST-type ofpbuf.

This commit avoids the problem by changing the interface to pull the
header from an ofpbuf that the caller already has.

This fixes a leak in testcase 909 "ofproto-dpif - patch ports".

Found by valgrind.

Reported-by: William Tu <u9012063 at gmail.com>
Reported-at: http://openvswitch.org/pipermail/dev/2016-January/064771.html
Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Andy Zhou <azhou at ovn.org>




More information about the git mailing list