Lines Matching refs:ret
204 int ret; in sendNetlinkRequest() local
215 (ret = recv(sock, &response, sizeof(response), 0)) != -1) { in sendNetlinkRequest()
216 if (ret == sizeof(response)) { in sendNetlinkRequest()
217 ret = response.err.error; // Netlink errors are negative errno. in sendNetlinkRequest()
218 if (ret) { in sendNetlinkRequest()
219 ALOGE("netlink response contains error (%s)", strerror(-ret)); in sendNetlinkRequest()
222 ALOGE("bad netlink response message size (%d != %zu)", ret, sizeof(response)); in sendNetlinkRequest()
223 ret = -EBADMSG; in sendNetlinkRequest()
227 ret = -errno; in sendNetlinkRequest()
234 return ret; in sendNetlinkRequest()
279 if (int ret = padInterfaceName(iif, iifName, &iifLength, &iifPadding)) { in modifyIpRule() local
280 return ret; in modifyIpRule()
282 if (int ret = padInterfaceName(oif, oifName, &oifLength, &oifPadding)) { in modifyIpRule() local
283 return ret; in modifyIpRule()
338 if (int ret = sendNetlinkRequest(action, flags, iov, ARRAY_SIZE(iov))) { in modifyIpRule() local
339 return ret; in modifyIpRule()
577 if (int ret = modifyIpRule(add ? RTM_NEWRULE : RTM_DELRULE, RULE_PRIORITY_VPN_OVERRIDE_OIF, in modifyOutputInterfaceRules() local
580 return ret; in modifyOutputInterfaceRules()
649 if (int ret = modifyIpRule(RTM_NEWRULE, RULE_PRIORITY_LEGACY_SYSTEM, ROUTE_TABLE_LEGACY_SYSTEM, in addLegacyRouteRules() local
651 return ret; in addLegacyRouteRules()
653 if (int ret = modifyIpRule(RTM_NEWRULE, RULE_PRIORITY_LEGACY_NETWORK, in addLegacyRouteRules() local
655 return ret; in addLegacyRouteRules()
668 if (int ret = modifyExplicitNetworkRule(localNetId, ROUTE_TABLE_LOCAL_NETWORK, PERMISSION_NONE, in addLocalNetworkRules() local
670 return ret; in addLocalNetworkRules()
692 int ret = ifc_up(interface); in configureDummyNetwork() local
694 if (ret) { in configureDummyNetwork()
699 if ((ret = modifyOutputInterfaceRules(interface, table, PERMISSION_NONE, in configureDummyNetwork()
701 ALOGE("Can't create oif rules for %s: %s", interface, strerror(-ret)); in configureDummyNetwork()
702 return ret; in configureDummyNetwork()
705 if ((ret = modifyIpRoute(RTM_NEWROUTE, table, interface, "0.0.0.0/0", NULL))) { in configureDummyNetwork()
706 ALOGE("Can't add IPv4 default route to %s: %s", interface, strerror(-ret)); in configureDummyNetwork()
707 return ret; in configureDummyNetwork()
710 if ((ret = modifyIpRoute(RTM_NEWROUTE, table, interface, "::/0", NULL))) { in configureDummyNetwork()
711 ALOGE("Can't add IPv6 default route to %s: %s", interface, strerror(-ret)); in configureDummyNetwork()
712 return ret; in configureDummyNetwork()
744 if (int ret = modifyIncomingPacketMark(netId, interface, PERMISSION_NONE, add)) { in modifyLocalNetwork() local
745 return ret; in modifyLocalNetwork()
758 if (int ret = modifyIncomingPacketMark(netId, interface, permission, add)) { in modifyPhysicalNetwork() local
759 return ret; in modifyPhysicalNetwork()
761 if (int ret = modifyExplicitNetworkRule(netId, table, permission, INVALID_UID, INVALID_UID, in modifyPhysicalNetwork() local
763 return ret; in modifyPhysicalNetwork()
765 if (int ret = modifyOutputInterfaceRules(interface, table, permission, INVALID_UID, INVALID_UID, in modifyPhysicalNetwork() local
767 return ret; in modifyPhysicalNetwork()
779 if (int ret = modifyIpRule(add ? RTM_NEWRULE : RTM_DELRULE, in modifyRejectNonSecureNetworkRule() local
783 return ret; in modifyRejectNonSecureNetworkRule()
799 if (int ret = modifyVpnUidRangeRule(table, range.first, range.second, secure, add)) { in modifyVirtualNetwork() local
800 return ret; in modifyVirtualNetwork()
802 if (int ret = modifyExplicitNetworkRule(netId, table, PERMISSION_NONE, range.first, in modifyVirtualNetwork() local
804 return ret; in modifyVirtualNetwork()
806 if (int ret = modifyOutputInterfaceRules(interface, table, PERMISSION_NONE, range.first, in modifyVirtualNetwork() local
808 return ret; in modifyVirtualNetwork()
813 if (int ret = modifyIncomingPacketMark(netId, interface, PERMISSION_NONE, add)) { in modifyVirtualNetwork() local
814 return ret; in modifyVirtualNetwork()
816 if (int ret = modifyVpnOutputToLocalRule(interface, add)) { in modifyVirtualNetwork() local
817 return ret; in modifyVirtualNetwork()
819 if (int ret = modifyVpnSystemPermissionRule(netId, table, secure, add)) { in modifyVirtualNetwork() local
820 return ret; in modifyVirtualNetwork()
904 int ret = modifyIpRoute(action, table, interface, destination, nexthop); in modifyRoute() local
906 if (ret && !(action == RTM_NEWROUTE && ret == -EEXIST)) { in modifyRoute()
907 return ret; in modifyRoute()
923 int ret = 0; in flushRoutes() local
950 ret = -EREMOTEIO; in flushRoutes()
956 if (!ret) { in flushRoutes()
960 return ret; in flushRoutes()
964 int ret = 0; in clearTetheringRules() local
965 while (ret == 0) { in clearTetheringRules()
966 ret = modifyIpRule(RTM_DELRULE, RULE_PRIORITY_TETHERING, 0, MARK_UNSET, MARK_UNSET, in clearTetheringRules()
970 if (ret == -ENOENT) { in clearTetheringRules()
973 return ret; in clearTetheringRules()
980 if (int ret = flushRules()) { in Init() local
981 return ret; in Init()
983 if (int ret = addLegacyRouteRules()) { in Init() local
984 return ret; in Init()
986 if (int ret = addLocalNetworkRules(localNetId)) { in Init() local
987 return ret; in Init()
989 if (int ret = addDirectlyConnectedRule()) { in Init() local
990 return ret; in Init()
992 if (int ret = addUnreachableRule()) { in Init() local
993 return ret; in Init()
1012 if (int ret = modifyPhysicalNetwork(netId, interface, permission, ACTION_ADD)) { in addInterfaceToPhysicalNetwork() local
1013 return ret; in addInterfaceToPhysicalNetwork()
1021 if (int ret = modifyPhysicalNetwork(netId, interface, permission, ACTION_DEL)) { in removeInterfaceFromPhysicalNetwork() local
1022 return ret; in removeInterfaceFromPhysicalNetwork()
1024 if (int ret = flushRoutes(interface)) { in removeInterfaceFromPhysicalNetwork() local
1025 return ret; in removeInterfaceFromPhysicalNetwork()
1027 if (int ret = clearTetheringRules(interface)) { in removeInterfaceFromPhysicalNetwork() local
1028 return ret; in removeInterfaceFromPhysicalNetwork()
1036 if (int ret = modifyVirtualNetwork(netId, interface, uidRanges, secure, ACTION_ADD, in addInterfaceToVirtualNetwork() local
1038 return ret; in addInterfaceToVirtualNetwork()
1046 if (int ret = modifyVirtualNetwork(netId, interface, uidRanges, secure, ACTION_DEL, in removeInterfaceFromVirtualNetwork() local
1048 return ret; in removeInterfaceFromVirtualNetwork()
1050 if (int ret = flushRoutes(interface)) { in removeInterfaceFromVirtualNetwork() local
1051 return ret; in removeInterfaceFromVirtualNetwork()
1061 if (int ret = modifyPhysicalNetwork(netId, interface, newPermission, ACTION_ADD)) { in modifyPhysicalNetworkPermission() local
1062 return ret; in modifyPhysicalNetworkPermission()