ClatIngress6Key.java - replace U32 ifindex with S32
These are allocated in order by the kernel, if we go
over 2 billion, we've got other problems... besides
U32 to S32 conversion will work just fine anyway.
Surprisingly it appears no further fixups are required
to make this compile, due to other places already being 'int's.
Bug: 245472520
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9008e20f40c983a1bb8a0547a61190f28042b22a
diff --git a/common/src/com/android/net/module/util/bpf/ClatIngress6Key.java b/common/src/com/android/net/module/util/bpf/ClatIngress6Key.java
index 1e2f4e0..561113c 100644
--- a/common/src/com/android/net/module/util/bpf/ClatIngress6Key.java
+++ b/common/src/com/android/net/module/util/bpf/ClatIngress6Key.java
@@ -24,8 +24,8 @@
/** Key type for clat ingress IPv6 maps. */
public class ClatIngress6Key extends Struct {
- @Field(order = 0, type = Type.U32)
- public final long iif; // The input interface index
+ @Field(order = 0, type = Type.S32)
+ public final int iif; // The input interface index
@Field(order = 1, type = Type.Ipv6Address)
public final Inet6Address pfx96; // The source /96 nat64 prefix, bottom 32 bits must be 0
@@ -33,7 +33,7 @@
@Field(order = 2, type = Type.Ipv6Address)
public final Inet6Address local6; // The full 128-bits of the destination IPv6 address
- public ClatIngress6Key(final long iif, final Inet6Address pfx96, final Inet6Address local6) {
+ public ClatIngress6Key(final int iif, final Inet6Address pfx96, final Inet6Address local6) {
this.iif = iif;
this.pfx96 = pfx96;
this.local6 = local6;