Loading Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -203,6 +203,7 @@ android_app { manifest: "AndroidManifest.xml", // The permission configuration *must* be included to ensure security of the device required: ["NetworkPermissionConfig"], updatable: true, } // Android library to derive test APKs for integration tests Loading common/netlinkclient/src/android/net/netlink/NduseroptMessage.java +8 −4 Original line number Diff line number Diff line Loading @@ -66,22 +66,23 @@ public class NduseroptMessage extends NetlinkMessage { super(header); // The structure itself. buf.order(ByteOrder.nativeOrder()); buf.order(ByteOrder.nativeOrder()); // Restored in the finally clause inside parse(). final int start = buf.position(); family = buf.get(); buf.get(); // Skip 1 byte of padding. opts_len = Short.toUnsignedInt(buf.getShort()); ifindex = buf.getInt(); icmp_type = buf.get(); icmp_code = buf.get(); buf.order(ByteOrder.BIG_ENDIAN); buf.position(buf.position() + 6); // Skip 6 bytes of padding. // The ND option. // Ensure we don't read past opts_len even if the option length is invalid. // Note that this check is not really necessary since if the option length is not valid, // this struct won't be very useful to the caller. buf.order(ByteOrder.BIG_ENDIAN); int oldLimit = buf.limit(); buf.limit(STRUCT_SIZE + opts_len); buf.limit(start + STRUCT_SIZE + opts_len); try { option = NdOption.parse(buf); } finally { Loading @@ -89,7 +90,7 @@ public class NduseroptMessage extends NetlinkMessage { } // The source address. int newPosition = STRUCT_SIZE + opts_len; int newPosition = start + STRUCT_SIZE + opts_len; if (newPosition >= buf.limit()) { throw new IllegalArgumentException("ND options extend past end of buffer"); } Loading Loading @@ -118,6 +119,7 @@ public class NduseroptMessage extends NetlinkMessage { */ public static NduseroptMessage parse(@NonNull StructNlMsgHdr header, @NonNull ByteBuffer buf) { if (buf == null || buf.remaining() < STRUCT_SIZE) return null; ByteOrder oldOrder = buf.order(); try { return new NduseroptMessage(header, buf); } catch (IllegalArgumentException | UnknownHostException | BufferUnderflowException e) { Loading @@ -125,6 +127,8 @@ public class NduseroptMessage extends NetlinkMessage { // Convention in this package is that null indicates that the option was truncated, so // callers must already handle it. return null; } finally { buf.order(oldOrder); } } Loading common/networkstackclient/aidl_api/networkstack-aidl-interfaces/current/android/net/dhcp/DhcpServingParamsParcel.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -26,4 +26,5 @@ parcelable DhcpServingParamsParcel { int linkMtu; boolean metered; int clientAddr; boolean changePrefixOnDecline; } common/networkstackclient/src/android/net/dhcp/DhcpServingParamsParcel.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -27,5 +27,5 @@ parcelable DhcpServingParamsParcel { int linkMtu; boolean metered; int clientAddr; boolean changePrefixOnDecline; } src/android/net/dhcp/DhcpClient.java +7 −0 Original line number Diff line number Diff line Loading @@ -233,6 +233,9 @@ public class DhcpClient extends StateMachine { public static final int CMD_START_PRECONNECTION = PUBLIC_BASE + 10; public static final int CMD_ABORT_PRECONNECTION = PUBLIC_BASE + 11; // Command to rebind the leased IPv4 address on L2 roaming happened. public static final int CMD_REFRESH_LINKADDRESS = PUBLIC_BASE + 12; /* Message.arg1 arguments to CMD_POST_DHCP_ACTION notification */ public static final int DHCP_SUCCESS = 1; public static final int DHCP_FAILURE = 2; Loading Loading @@ -1674,6 +1677,9 @@ public class DhcpClient extends StateMachine { case CMD_RENEW_DHCP: preDhcpTransitionTo(mWaitBeforeRenewalState, mDhcpRenewingState); return HANDLED; case CMD_REFRESH_LINKADDRESS: transitionTo(mDhcpRebindingState); return HANDLED; default: return NOT_HANDLED; } Loading Loading @@ -1717,6 +1723,7 @@ public class DhcpClient extends StateMachine { Log.d(TAG, "Renewed lease not for our current IP address!"); notifyFailure(); transitionTo(mDhcpInitState); return; } setDhcpLeaseExpiry(packet); // Updating our notion of DhcpResults here only causes the Loading Loading
Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -203,6 +203,7 @@ android_app { manifest: "AndroidManifest.xml", // The permission configuration *must* be included to ensure security of the device required: ["NetworkPermissionConfig"], updatable: true, } // Android library to derive test APKs for integration tests Loading
common/netlinkclient/src/android/net/netlink/NduseroptMessage.java +8 −4 Original line number Diff line number Diff line Loading @@ -66,22 +66,23 @@ public class NduseroptMessage extends NetlinkMessage { super(header); // The structure itself. buf.order(ByteOrder.nativeOrder()); buf.order(ByteOrder.nativeOrder()); // Restored in the finally clause inside parse(). final int start = buf.position(); family = buf.get(); buf.get(); // Skip 1 byte of padding. opts_len = Short.toUnsignedInt(buf.getShort()); ifindex = buf.getInt(); icmp_type = buf.get(); icmp_code = buf.get(); buf.order(ByteOrder.BIG_ENDIAN); buf.position(buf.position() + 6); // Skip 6 bytes of padding. // The ND option. // Ensure we don't read past opts_len even if the option length is invalid. // Note that this check is not really necessary since if the option length is not valid, // this struct won't be very useful to the caller. buf.order(ByteOrder.BIG_ENDIAN); int oldLimit = buf.limit(); buf.limit(STRUCT_SIZE + opts_len); buf.limit(start + STRUCT_SIZE + opts_len); try { option = NdOption.parse(buf); } finally { Loading @@ -89,7 +90,7 @@ public class NduseroptMessage extends NetlinkMessage { } // The source address. int newPosition = STRUCT_SIZE + opts_len; int newPosition = start + STRUCT_SIZE + opts_len; if (newPosition >= buf.limit()) { throw new IllegalArgumentException("ND options extend past end of buffer"); } Loading Loading @@ -118,6 +119,7 @@ public class NduseroptMessage extends NetlinkMessage { */ public static NduseroptMessage parse(@NonNull StructNlMsgHdr header, @NonNull ByteBuffer buf) { if (buf == null || buf.remaining() < STRUCT_SIZE) return null; ByteOrder oldOrder = buf.order(); try { return new NduseroptMessage(header, buf); } catch (IllegalArgumentException | UnknownHostException | BufferUnderflowException e) { Loading @@ -125,6 +127,8 @@ public class NduseroptMessage extends NetlinkMessage { // Convention in this package is that null indicates that the option was truncated, so // callers must already handle it. return null; } finally { buf.order(oldOrder); } } Loading
common/networkstackclient/aidl_api/networkstack-aidl-interfaces/current/android/net/dhcp/DhcpServingParamsParcel.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -26,4 +26,5 @@ parcelable DhcpServingParamsParcel { int linkMtu; boolean metered; int clientAddr; boolean changePrefixOnDecline; }
common/networkstackclient/src/android/net/dhcp/DhcpServingParamsParcel.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -27,5 +27,5 @@ parcelable DhcpServingParamsParcel { int linkMtu; boolean metered; int clientAddr; boolean changePrefixOnDecline; }
src/android/net/dhcp/DhcpClient.java +7 −0 Original line number Diff line number Diff line Loading @@ -233,6 +233,9 @@ public class DhcpClient extends StateMachine { public static final int CMD_START_PRECONNECTION = PUBLIC_BASE + 10; public static final int CMD_ABORT_PRECONNECTION = PUBLIC_BASE + 11; // Command to rebind the leased IPv4 address on L2 roaming happened. public static final int CMD_REFRESH_LINKADDRESS = PUBLIC_BASE + 12; /* Message.arg1 arguments to CMD_POST_DHCP_ACTION notification */ public static final int DHCP_SUCCESS = 1; public static final int DHCP_FAILURE = 2; Loading Loading @@ -1674,6 +1677,9 @@ public class DhcpClient extends StateMachine { case CMD_RENEW_DHCP: preDhcpTransitionTo(mWaitBeforeRenewalState, mDhcpRenewingState); return HANDLED; case CMD_REFRESH_LINKADDRESS: transitionTo(mDhcpRebindingState); return HANDLED; default: return NOT_HANDLED; } Loading Loading @@ -1717,6 +1723,7 @@ public class DhcpClient extends StateMachine { Log.d(TAG, "Renewed lease not for our current IP address!"); notifyFailure(); transitionTo(mDhcpInitState); return; } setDhcpLeaseExpiry(packet); // Updating our notion of DhcpResults here only causes the Loading