Commit ed690aa4 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Operation buffer align fix from HEAD

parent 68e078cf
......@@ -172,8 +172,8 @@ bdb_online_index( void *ctx, void *arg )
struct bdb_info *bdb = be->be_private;
Connection conn = {0};
char opbuf[OPERATION_BUFFER_SIZE];
Operation *op = (Operation *)opbuf;
OperationBuffer opbuf;
Operation *op = (Operation *) &opbuf;
DBC *curs;
DBT key, data;
......
......@@ -642,7 +642,7 @@ monitor_filter2ndn(
struct berval *ndn )
{
Connection conn = { 0 };
char opbuf[OPERATION_BUFFER_SIZE];
OperationBuffer opbuf;
Operation *op;
SlapReply rs = { 0 };
slap_callback cb = { NULL, monitor_filter2ndn_cb, NULL, NULL };
......@@ -654,7 +654,7 @@ monitor_filter2ndn(
return -1;
}
op = (Operation *)opbuf;
op = (Operation *) &opbuf;
connection_fake_init( &conn, op, &conn );
op->o_tag = LDAP_REQ_SEARCH;
......
......@@ -224,8 +224,8 @@ backsql_db_open(
SQLHDBC dbh = SQL_NULL_HDBC;
struct berbuf bb = BB_NULL;
char opbuf[ OPERATION_BUFFER_SIZE ];
Operation* op = (Operation *)opbuf;
OperationBuffer opbuf;
Operation* op = (Operation *) &opbuf;
Debug( LDAP_DEBUG_TRACE, "==>backsql_db_open(): "
"testing RDBMS connection\n", 0, 0, 0 );
......@@ -581,8 +581,8 @@ backsql_db_close(
int
backsql_connection_destroy( Backend *bd, Connection *c )
{
char opbuf[ OPERATION_BUFFER_SIZE ];
Operation* op = (Operation *)opbuf;
OperationBuffer opbuf;
Operation* op = (Operation *) &opbuf;
op->o_hdr = (Opheader *)&op[ 1 ];
op->o_connid = c->c_connid;
......
......@@ -2613,7 +2613,7 @@ config_setup_ldif( BackendDB *be, const char *dir, int readit ) {
setup_cookie sc;
slap_callback cb = { NULL, config_ldif_resp, NULL, NULL };
Connection conn = {0};
char opbuf[OPERATION_BUFFER_SIZE];
OperationBuffer opbuf;
Operation *op;
SlapReply rs = {REP_RESULT};
Filter filter = { LDAP_FILTER_PRESENT };
......@@ -2665,7 +2665,7 @@ config_setup_ldif( BackendDB *be, const char *dir, int readit ) {
if ( readit ) {
void *thrctx = ldap_pvt_thread_pool_context();
op = (Operation *)opbuf;
op = (Operation *) &opbuf;
connection_fake_init( &conn, op, thrctx );
filter.f_desc = slap_schema.si_ad_objectClass;
......@@ -4053,7 +4053,7 @@ config_back_db_open( BackendDB *be )
BackendInfo *bi;
ConfigArgs c;
Connection conn = {0};
char opbuf[OPERATION_BUFFER_SIZE];
OperationBuffer opbuf;
Operation *op;
slap_callback cb = { NULL, slap_null_cb, NULL, NULL };
SlapReply rs = {REP_RESULT};
......@@ -4065,7 +4065,7 @@ config_back_db_open( BackendDB *be )
if ( cfb->cb_use_ldif ) {
thrctx = ldap_pvt_thread_pool_context();
op = (Operation *)opbuf;
op = (Operation *) &opbuf;
connection_fake_init( &conn, op, thrctx );
op->o_dn = be->be_rootdn;
......
......@@ -464,8 +464,8 @@ accesslog_purge( void *ctx, void *arg )
struct log_info *li = rtask->arg;
Connection conn = {0};
char opbuf[OPERATION_BUFFER_SIZE];
Operation *op = (Operation *)opbuf;
OperationBuffer opbuf;
Operation *op = (Operation *) &opbuf;
SlapReply rs = {REP_RESULT};
slap_callback cb = { NULL, log_old_lookup, NULL, NULL };
Filter f;
......
......@@ -1462,7 +1462,7 @@ consistency_check(
cache_manager *cm = on->on_bi.bi_private;
query_manager *qm = cm->qm;
Connection conn = {0};
char opbuf[OPERATION_BUFFER_SIZE];
OperationBuffer opbuf;
Operation *op;
SlapReply rs = {REP_RESULT};
......@@ -1470,7 +1470,7 @@ consistency_check(
int i, return_val, pause = 1;
QueryTemplate* templ;
op = (Operation *)opbuf;
op = (Operation *) &opbuf;
connection_fake_init( &conn, op, ctx );
op->o_bd = &cm->db;
......
......@@ -861,11 +861,11 @@ syncprov_qtask( void *ctx, void *arg )
struct re_s *rtask = arg;
syncops *so = rtask->arg;
slap_overinst *on = so->s_op->o_private;
char opbuf[OPERATION_BUFFER_SIZE];
OperationBuffer opbuf;
Operation *op;
BackendDB be;
op = (Operation *)opbuf;
op = (Operation *) &opbuf;
*op = *so->s_op;
op->o_hdr = (Opheader *)(op+1);
op->o_controls = (void **)(op->o_hdr+1);
......@@ -2217,9 +2217,9 @@ syncprov_db_open(
syncprov_info_t *si = (syncprov_info_t *)on->on_bi.bi_private;
Connection conn;
char opbuf[OPERATION_BUFFER_SIZE];
OperationBuffer opbuf;
char ctxcsnbuf[LDAP_LUTIL_CSNSTR_BUFSIZE];
Operation *op = (Operation *)opbuf;
Operation *op = (Operation *) &opbuf;
Entry *e;
Attribute *a;
int rc;
......@@ -2307,8 +2307,8 @@ syncprov_db_close(
}
if ( si->si_numops ) {
Connection conn;
char opbuf[OPERATION_BUFFER_SIZE];
Operation *op = (Operation *)opbuf;
OperationBuffer opbuf;
Operation *op = (Operation *) &opbuf;
SlapReply rs = {REP_RESULT};
void *thrctx;
......
......@@ -2555,7 +2555,11 @@ typedef struct slap_op {
LDAP_STAILQ_ENTRY(slap_op) o_next; /* next operation in list */
} Operation;
#define OPERATION_BUFFER_SIZE (sizeof(Operation)+sizeof(Opheader)+SLAP_MAX_CIDS*sizeof(void *))
#define OPERATION_BUFFER_SIZE ( sizeof(Operation) + sizeof(Opheader) + \
SLAP_MAX_CIDS*sizeof(void *) )
typedef LBER_ALIGNED_BUFFER(operation_buffer_u,OPERATION_BUFFER_SIZE)
OperationBuffer;
#define send_ldap_error( op, rs, err, text ) do { \
(rs)->sr_err = err; (rs)->sr_text = text; \
......
......@@ -65,7 +65,7 @@ slapacl( int argc, char **argv )
const char *progname = "slapacl";
Connection conn = { 0 };
Listener listener;
char opbuf[OPERATION_BUFFER_SIZE];
OperationBuffer opbuf;
Operation *op = NULL;
Entry e = { 0 }, *ep = &e;
char *attr = NULL;
......@@ -94,7 +94,7 @@ slapacl( int argc, char **argv )
argv = &argv[ optind ];
argc -= optind;
op = (Operation *)opbuf;
op = (Operation *) &opbuf;
connection_fake_init( &conn, op, &conn );
conn.c_listener = &listener;
......
......@@ -44,33 +44,33 @@ static char maxcsnbuf[ LDAP_LUTIL_CSNSTR_BUFSIZE ];
int
slapadd( int argc, char **argv )
{
char *buf = NULL;
int lineno;
int lmax;
int rc = EXIT_SUCCESS;
char *buf = NULL;
const char *text;
char textbuf[SLAP_TEXT_BUFLEN] = { '\0' };
size_t textlen = sizeof textbuf;
const char *progname = "slapadd";
int manage = 0;
struct berval csn;
struct berval maxcsn;
int match;
struct berval bvtext;
Attribute *attr;
Entry *ctxcsn_e;
ID ctxcsn_id, id;
OperationBuffer opbuf;
Operation *op;
int match;
int ret;
struct berval bvtext;
int checkvals;
char opbuf[OPERATION_BUFFER_SIZE];
Operation *op;
int lineno;
int lmax;
int rc = EXIT_SUCCESS;
int manage = 0;
slap_tool_init( progname, SLAPADD, argc, argv );
memset( opbuf, 0, sizeof(opbuf) );
op = (Operation *)opbuf;
memset( &opbuf, 0, sizeof(opbuf) );
op = (Operation *) &opbuf;
if( !be->be_entry_open ||
!be->be_entry_close ||
......
......@@ -80,7 +80,7 @@ slapauth( int argc, char **argv )
int rc = EXIT_SUCCESS;
const char *progname = "slapauth";
Connection conn = {0};
char opbuf[OPERATION_BUFFER_SIZE];
OperationBuffer opbuf;
Operation *op;
slap_tool_init( progname, SLAPAUTH, argc, argv );
......@@ -88,7 +88,7 @@ slapauth( int argc, char **argv )
argv = &argv[ optind ];
argc -= optind;
op = (Operation *)opbuf;
op = (Operation *) &opbuf;
connection_fake_init( &conn, op, &conn );
conn.c_sasl_bind_mech = mech;
......
......@@ -902,7 +902,7 @@ do_syncrepl(
struct re_s* rtask = arg;
syncinfo_t *si = ( syncinfo_t * ) rtask->arg;
Connection conn = {0};
char opbuf[OPERATION_BUFFER_SIZE];
OperationBuffer opbuf;
Operation *op;
int rc = LDAP_SUCCESS;
int first = 0;
......@@ -938,7 +938,7 @@ do_syncrepl(
return NULL;
}
op = (Operation *)opbuf;
op = (Operation *) &opbuf;
connection_fake_init( &conn, op, ctx );
/* use global malloc for now */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment