Fixup netlink socket creation to make corresponding fix in JNI

Corresponding JNI fix is:

    aosp/516339
    oc-mr1-dev:3102743

Test: as follows
    - built
    - flashed
    - booted
    - make vts -j30 BUILD_GOOGLE_VTS=true && \
      vts-tradefed run commandAndExit vts --skip-all-system-status-check --primary-abi-only --skip-preconditions --module VtsHalTetherOffloadControlV1_0Target -l DEBUG

      10-20 17:48:28 I/ResultReporter: Invocation finished in 5m 32s. PASSED: 38, FAILED: 0, MODULES: 1 of 1

Bug: 68018148

Change-Id: I5aa019d708abaff61387b83a857e9e8226709842
This commit is contained in:
Erik Kline 2017-10-20 17:08:38 +09:00
parent a555e04f8c
commit d97f8714f0
2 changed files with 4 additions and 4 deletions

View file

@ -43,8 +43,8 @@ using android::sp;
#define ASSERT_FALSE_CALLBACK \
[&](bool success, const hidl_string& errMsg) { ASSERT_FALSE(success) << errMsg.c_str(); }
const unsigned kFd1Groups = NFNLGRP_CONNTRACK_NEW | NFNLGRP_CONNTRACK_DESTROY;
const unsigned kFd2Groups = NFNLGRP_CONNTRACK_UPDATE | NFNLGRP_CONNTRACK_DESTROY;
const unsigned kFd1Groups = NF_NETLINK_CONNTRACK_NEW | NF_NETLINK_CONNTRACK_DESTROY;
const unsigned kFd2Groups = NF_NETLINK_CONNTRACK_UPDATE | NF_NETLINK_CONNTRACK_DESTROY;
inline const sockaddr* asSockaddr(const sockaddr_nl* nladdr) {
return reinterpret_cast<const sockaddr*>(nladdr);

View file

@ -131,7 +131,7 @@ class OffloadControlHidlTestBase : public testing::VtsHalHidlTargetTestBase {
config = testing::VtsHalHidlTargetTestBase::getService<IOffloadConfig>();
ASSERT_NE(nullptr, config.get()) << "Could not get HIDL instance";
unique_fd fd1(conntrackSocket(NFNLGRP_CONNTRACK_NEW | NFNLGRP_CONNTRACK_DESTROY));
unique_fd fd1(conntrackSocket(NF_NETLINK_CONNTRACK_NEW | NF_NETLINK_CONNTRACK_DESTROY));
if (fd1.get() < 0) {
ALOGE("Unable to create conntrack handles: %d/%s", errno, strerror(errno));
FAIL();
@ -141,7 +141,7 @@ class OffloadControlHidlTestBase : public testing::VtsHalHidlTargetTestBase {
hidl_handle h1;
h1.setTo(nativeHandle1, true);
unique_fd fd2(conntrackSocket(NFNLGRP_CONNTRACK_UPDATE | NFNLGRP_CONNTRACK_DESTROY));
unique_fd fd2(conntrackSocket(NF_NETLINK_CONNTRACK_UPDATE | NF_NETLINK_CONNTRACK_DESTROY));
if (fd2.get() < 0) {
ALOGE("Unable to create conntrack handles: %d/%s", errno, strerror(errno));
FAIL();