Dump the input destination MAC address for IPv4 flows. am: e9bc8c9db7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1662403 Change-Id: I461c6214d0591d426f6cbc5f23dd2b56551abdcb
This commit is contained in:
@@ -814,7 +814,7 @@ public class BpfCoordinator {
|
|||||||
final int upstreamIfindex = rule.upstreamIfindex;
|
final int upstreamIfindex = rule.upstreamIfindex;
|
||||||
pw.println(String.format("%d(%s) %d(%s) %s %s %s", upstreamIfindex,
|
pw.println(String.format("%d(%s) %d(%s) %s %s %s", upstreamIfindex,
|
||||||
mInterfaceNames.get(upstreamIfindex), rule.downstreamIfindex,
|
mInterfaceNames.get(upstreamIfindex), rule.downstreamIfindex,
|
||||||
downstreamIface, rule.address, rule.srcMac, rule.dstMac));
|
downstreamIface, rule.address.getHostAddress(), rule.srcMac, rule.dstMac));
|
||||||
}
|
}
|
||||||
pw.decreaseIndent();
|
pw.decreaseIndent();
|
||||||
}
|
}
|
||||||
@@ -851,9 +851,10 @@ public class BpfCoordinator {
|
|||||||
} catch (UnknownHostException impossible) {
|
} catch (UnknownHostException impossible) {
|
||||||
throw new AssertionError("4-byte array not valid IPv4 address!");
|
throw new AssertionError("4-byte array not valid IPv4 address!");
|
||||||
}
|
}
|
||||||
return String.format("%d(%s) %d(%s) %s:%d -> %s:%d -> %s:%d",
|
return String.format("[%s] %d(%s) %s:%d -> %d(%s) %s:%d -> %s:%d",
|
||||||
key.iif, getIfName(key.iif), value.oif, getIfName(value.oif),
|
key.dstMac, key.iif, getIfName(key.iif), private4, key.srcPort,
|
||||||
private4, key.srcPort, public4, value.srcPort, dst4, key.dstPort);
|
value.oif, getIfName(value.oif),
|
||||||
|
public4, value.srcPort, dst4, key.dstPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dumpIpv4ForwardingRules(IndentingPrintWriter pw) {
|
private void dumpIpv4ForwardingRules(IndentingPrintWriter pw) {
|
||||||
@@ -866,7 +867,7 @@ public class BpfCoordinator {
|
|||||||
pw.println("No IPv4 rules");
|
pw.println("No IPv4 rules");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pw.println("[IPv4]: iif(iface) oif(iface) src nat dst");
|
pw.println("IPv4: [inDstMac] iif(iface) src -> nat -> dst");
|
||||||
pw.increaseIndent();
|
pw.increaseIndent();
|
||||||
map.forEach((k, v) -> pw.println(ipv4RuleToString(k, v)));
|
map.forEach((k, v) -> pw.println(ipv4RuleToString(k, v)));
|
||||||
} catch (ErrnoException e) {
|
} catch (ErrnoException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user