Loading libsysutils/src/NetlinkEvent.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -501,6 +501,8 @@ bool NetlinkEvent::parseNdUserOptMessage(const struct nlmsghdr *nh) { asprintf(&mParams[0], "INTERFACE=%s", ifname); asprintf(&mParams[1], "LIFETIME=%u", lifetime); mParams[2] = buf; } else if (opthdr->nd_opt_type == ND_OPT_DNSSL) { // TODO: support DNSSL. } else { SLOGD("Unknown ND option type %d\n", opthdr->nd_opt_type); return false; Loading libunwindstack/tools/unwind_info.cpp +20 −5 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <fcntl.h> #include <inttypes.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/mman.h> #include <sys/stat.h> Loading Loading @@ -102,12 +103,12 @@ void DumpDwarfSection(ElfInterface* interface, DwarfSection* section, uint64_t l } } int GetElfInfo(const char* file) { int GetElfInfo(const char* file, uint64_t offset) { // Send all log messages to stdout. log_to_stdout(true); MemoryFileAtOffset* memory = new MemoryFileAtOffset; if (!memory->Init(file, 0)) { if (!memory->Init(file, offset)) { // Initializatation failed. printf("Failed to init\n"); return 1; Loading Loading @@ -164,8 +165,12 @@ int GetElfInfo(const char* file) { } // namespace unwindstack int main(int argc, char** argv) { if (argc != 2) { printf("Need to pass the name of an elf file to the program.\n"); if (argc != 2 && argc != 3) { printf("Usage: unwind_info ELF_FILE [OFFSET]\n"); printf(" ELF_FILE\n"); printf(" The path to an elf file.\n"); printf(" OFFSET\n"); printf(" Use the offset into the ELF file as the beginning of the elf.\n"); return 1; } Loading @@ -179,5 +184,15 @@ int main(int argc, char** argv) { return 1; } return unwindstack::GetElfInfo(argv[1]); uint64_t offset = 0; if (argc == 3) { char* end; offset = strtoull(argv[2], &end, 16); if (*end != '\0') { printf("Malformed OFFSET value: %s\n", argv[2]); return 1; } } return unwindstack::GetElfInfo(argv[1], offset); } trusty/keymaster/trusty_keymaster_ipc.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,11 @@ int trusty_keymaster_call(uint32_t cmd, void* in, uint32_t in_size, uint8_t* out size_t msg_size = in_size + sizeof(struct keymaster_message); struct keymaster_message* msg = reinterpret_cast<struct keymaster_message*>(malloc(msg_size)); if (!msg) { ALOGE("failed to allocate msg buffer\n"); return -EINVAL; } msg->cmd = cmd; memcpy(msg->payload, in, in_size); Loading Loading
libsysutils/src/NetlinkEvent.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -501,6 +501,8 @@ bool NetlinkEvent::parseNdUserOptMessage(const struct nlmsghdr *nh) { asprintf(&mParams[0], "INTERFACE=%s", ifname); asprintf(&mParams[1], "LIFETIME=%u", lifetime); mParams[2] = buf; } else if (opthdr->nd_opt_type == ND_OPT_DNSSL) { // TODO: support DNSSL. } else { SLOGD("Unknown ND option type %d\n", opthdr->nd_opt_type); return false; Loading
libunwindstack/tools/unwind_info.cpp +20 −5 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <fcntl.h> #include <inttypes.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/mman.h> #include <sys/stat.h> Loading Loading @@ -102,12 +103,12 @@ void DumpDwarfSection(ElfInterface* interface, DwarfSection* section, uint64_t l } } int GetElfInfo(const char* file) { int GetElfInfo(const char* file, uint64_t offset) { // Send all log messages to stdout. log_to_stdout(true); MemoryFileAtOffset* memory = new MemoryFileAtOffset; if (!memory->Init(file, 0)) { if (!memory->Init(file, offset)) { // Initializatation failed. printf("Failed to init\n"); return 1; Loading Loading @@ -164,8 +165,12 @@ int GetElfInfo(const char* file) { } // namespace unwindstack int main(int argc, char** argv) { if (argc != 2) { printf("Need to pass the name of an elf file to the program.\n"); if (argc != 2 && argc != 3) { printf("Usage: unwind_info ELF_FILE [OFFSET]\n"); printf(" ELF_FILE\n"); printf(" The path to an elf file.\n"); printf(" OFFSET\n"); printf(" Use the offset into the ELF file as the beginning of the elf.\n"); return 1; } Loading @@ -179,5 +184,15 @@ int main(int argc, char** argv) { return 1; } return unwindstack::GetElfInfo(argv[1]); uint64_t offset = 0; if (argc == 3) { char* end; offset = strtoull(argv[2], &end, 16); if (*end != '\0') { printf("Malformed OFFSET value: %s\n", argv[2]); return 1; } } return unwindstack::GetElfInfo(argv[1], offset); }
trusty/keymaster/trusty_keymaster_ipc.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,11 @@ int trusty_keymaster_call(uint32_t cmd, void* in, uint32_t in_size, uint8_t* out size_t msg_size = in_size + sizeof(struct keymaster_message); struct keymaster_message* msg = reinterpret_cast<struct keymaster_message*>(malloc(msg_size)); if (!msg) { ALOGE("failed to allocate msg buffer\n"); return -EINVAL; } msg->cmd = cmd; memcpy(msg->payload, in, in_size); Loading