Skip to content

Commit

Permalink
psample: Fix user API breakage
Browse files Browse the repository at this point in the history
commit e43accb upstream.

Cited commit added a new attribute before the existing group reference
count attribute, thereby changing its value and breaking existing
applications on new kernels.

Before:

 # psample -l
 libpsample ERROR psample_group_foreach: failed to recv message: Operation not supported

After:

 # psample -l
 Group Num       Refcount        Group Seq
 1               1               0

Fix by restoring the value of the old attribute and remove the
misleading comments from the enumerator to avoid future bugs.

Cc: stable@vger.kernel.org
Fixes: d8bed68 ("net: psample: Add tunnel support")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reported-by: Adiel Bidani <adielb@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
idosch authored and gregkh committed Mar 30, 2021
1 parent 2050605 commit 635bb49
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions include/uapi/linux/psample.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@
#define __UAPI_PSAMPLE_H

enum {
/* sampled packet metadata */
PSAMPLE_ATTR_IIFINDEX,
PSAMPLE_ATTR_OIFINDEX,
PSAMPLE_ATTR_ORIGSIZE,
PSAMPLE_ATTR_SAMPLE_GROUP,
PSAMPLE_ATTR_GROUP_SEQ,
PSAMPLE_ATTR_SAMPLE_RATE,
PSAMPLE_ATTR_DATA,
PSAMPLE_ATTR_TUNNEL,

/* commands attributes */
PSAMPLE_ATTR_GROUP_REFCOUNT,
PSAMPLE_ATTR_TUNNEL,

__PSAMPLE_ATTR_MAX
};
Expand Down

0 comments on commit 635bb49

Please sign in to comment.