Skip to content
Snippets Groups Projects
Commit 0ba23a5a authored by Maciej Żenczykowski's avatar Maciej Żenczykowski
Browse files

CookieTagMapValue.java - uid U32 -> S32


The kernel is actually not consistent in whether uids & gids
are signed or unsigned, and neither is our Java code, which
also commonly uses just 'int' for uid.  In practice values
greater or equal to 2**31 often don't quite work right.
For example icmp sockets are enabled via a sysctl that
takes a minimum and maximum gid - and these are signed int32s.

Test: TreeHugger
Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
Change-Id: I6576798cfeb52bf5574bf6853f0f7378022b3a2f
parent f4913b13
No related branches found
No related tags found
No related merge requests found
......@@ -24,13 +24,13 @@ import com.android.net.module.util.Struct.Type;
* Value for cookie tag map.
*/
public class CookieTagMapValue extends Struct {
@Field(order = 0, type = Type.U32)
public final long uid;
@Field(order = 0, type = Type.S32)
public final int uid;
@Field(order = 1, type = Type.U32)
public final long tag;
public CookieTagMapValue(final long uid, final long tag) {
public CookieTagMapValue(final int uid, final long tag) {
this.uid = uid;
this.tag = tag;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment