Test: as follows
- built
- flashed
- booted
- "runtest frameworks-net" passes
- turned on debugging and walked around watching IpReachabilityMonitor
force neighbors into NUD_PROBE state without error
- observed NAT callbacks happening without any reported errors
- watched:
adb shell cat /proc/net/nf_conntrack | egrep '192[.]168[.]43[.]' | sort -n -k5
for correct timeout updates
Bug: 29337859
Bug: 32163131
Merged-In: I82ac60e5ad79ec64a13df6ec56b5b51b223f8dde
Merged-In: I09bc685e821ec5e871576a54c4290edea4c5160b
Merged-In: I4d180369a8f64ee494b016656988252d98a09ba4
Change-Id: Icb23da64cfaa3a19f7bc75fba426a52b0994fb0f
(cherry picked from commit 7a65bc62fb)
52 lines
1.4 KiB
Java
52 lines
1.4 KiB
Java
/*
|
|
* Copyright (C) 2017 The Android Open Source Project
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
package android.net.netlink;
|
|
|
|
import libcore.io.SizeOf;
|
|
|
|
import java.nio.ByteBuffer;
|
|
|
|
|
|
/**
|
|
* struct nfgenmsg
|
|
*
|
|
* see <linux_src>/include/uapi/linux/netfilter/nfnetlink.h
|
|
*
|
|
* @hide
|
|
*/
|
|
public class StructNfGenMsg {
|
|
public static final int STRUCT_SIZE = 2 + SizeOf.SHORT;
|
|
|
|
public static final int NFNETLINK_V0 = 0;
|
|
|
|
final public byte nfgen_family;
|
|
final public byte version;
|
|
final public short res_id; // N.B.: this is big endian in the kernel
|
|
|
|
public StructNfGenMsg(byte family) {
|
|
nfgen_family = family;
|
|
version = (byte) NFNETLINK_V0;
|
|
res_id = (short) 0;
|
|
}
|
|
|
|
public void pack(ByteBuffer byteBuffer) {
|
|
byteBuffer.put(nfgen_family);
|
|
byteBuffer.put(version);
|
|
byteBuffer.putShort(res_id);
|
|
}
|
|
}
|