From feb1e82ebe95aadcf2017b8286ba05b6338aead1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Thu, 28 Aug 2025 18:11:47 -0700 Subject: [PATCH] BpfCoordinator: include PMTU in IPv6 BPF forwarding rule dumps. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: 432676104 Test: TreeHugger Flag: EXEMPT DEBUG Signed-off-by: Maciej Żenczykowski Change-Id: I29886b97e402483d0edf9ccd0a38f4555f83b736 --- .../networkstack/tethering/BpfCoordinator.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Tethering/src/com/android/networkstack/tethering/BpfCoordinator.java b/Tethering/src/com/android/networkstack/tethering/BpfCoordinator.java index 89edc32cb8..2789948711 100644 --- a/Tethering/src/com/android/networkstack/tethering/BpfCoordinator.java +++ b/Tethering/src/com/android/networkstack/tethering/BpfCoordinator.java @@ -1446,9 +1446,10 @@ public class BpfCoordinator { } private String ipv6UpstreamRuleToString(TetherUpstream6Key key, Tether6Value value) { - return String.format("%d(%s) [%s] [%s] -> %d(%s) %04x [%s] [%s]", + return String.format("%d(%s) [%s] [%s] -> %d(%s) %04x [%s] [%s] %d", key.iif, getIfName(key.iif), key.dstMac, bytesToPrefix(key.src64), value.oif, - getIfName(value.oif), value.ethProto, value.ethSrcMac, value.ethDstMac); + getIfName(value.oif), value.ethProto, value.ethSrcMac, value.ethDstMac, + value.pmtu); } private void dumpIpv6UpstreamRules(IndentingPrintWriter pw) { @@ -1474,9 +1475,9 @@ public class BpfCoordinator { } catch (UnknownHostException impossible) { throw new AssertionError("IP address array not valid IPv6 address!"); } - return String.format("%d(%s) [%s] %s -> %d(%s) %04x [%s] [%s]", + return String.format("%d(%s) [%s] %s -> %d(%s) %04x [%s] [%s] %d", key.iif, getIfName(key.iif), key.dstMac, neigh6, value.oif, getIfName(value.oif), - value.ethProto, value.ethSrcMac, value.ethDstMac); + value.ethProto, value.ethSrcMac, value.ethDstMac, value.pmtu); } private void dumpIpv6DownstreamRules(IndentingPrintWriter pw) { @@ -1499,13 +1500,13 @@ public class BpfCoordinator { // duplicate bpf map dump code. private void dumpBpfForwardingRulesIpv6(IndentingPrintWriter pw) { pw.println("IPv6 Upstream: iif(iface) [inDstMac] [sourcePrefix] -> oif(iface) etherType " - + "[outSrcMac] [outDstMac]"); + + "[outSrcMac] [outDstMac] pmtu"); pw.increaseIndent(); dumpIpv6UpstreamRules(pw); pw.decreaseIndent(); pw.println("IPv6 Downstream: iif(iface) [inDstMac] neigh6 -> oif(iface) etherType " - + "[outSrcMac] [outDstMac]"); + + "[outSrcMac] [outDstMac] pmtu"); pw.increaseIndent(); dumpIpv6DownstreamRules(pw); pw.decreaseIndent();