Commit e43accba authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller
Browse files

psample: Fix user API breakage



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: d8bed686 ("net: psample: Add tunnel support")
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Reported-by: default avatarAdiel Bidani <adielb@nvidia.com>
Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bf459478
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
#define __UAPI_PSAMPLE_H

enum {
	/* sampled packet metadata */
	PSAMPLE_ATTR_IIFINDEX,
	PSAMPLE_ATTR_OIFINDEX,
	PSAMPLE_ATTR_ORIGSIZE,
@@ -11,10 +10,8 @@ enum {
	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
};