Merge branch 'master' of git.komect.net:ISG/secogateway
This commit is contained in:
commit
d3bf061fd1
|
@ -3,6 +3,11 @@
|
|||
|
||||
#include "trace_def.h"
|
||||
|
||||
typedef enum {
|
||||
REPLY_OP_NO_NEED = 0x0,
|
||||
REPLY_OP_NEED
|
||||
} reply_op_t;
|
||||
|
||||
enum {
|
||||
TRACE_MSG_POLICY_REQ = 0x0,
|
||||
TRACE_MSG_POLICY_REPLY
|
||||
|
@ -11,6 +16,7 @@ enum {
|
|||
typedef struct _trace_hdr {
|
||||
u32 ver;
|
||||
u32 seq;
|
||||
reply_op_t is_reply;
|
||||
} trace_hdr_t;
|
||||
|
||||
typedef struct _trace_req {
|
||||
|
|
|
@ -49,6 +49,10 @@ static int trace_rcv_policy(struct sk_buff *skb, struct nlmsghdr *nlh)
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (hdr->is_reply == REPLY_OP_NO_NEED) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
reply_skb = nlmsg_new(TRACE_REPLY_SZ, GFP_KERNEL);
|
||||
if (reply_skb == NULL) {
|
||||
printk(KERN_ERR"Allocating skb memory is failure");
|
||||
|
|
|
@ -146,7 +146,7 @@ static void *cb_thread(void *arg)
|
|||
}
|
||||
|
||||
|
||||
static trace_ret_t cfg_channel_send(const uint32_t seq, const trace_policy_t *policy)
|
||||
static trace_ret_t cfg_channel_send(const uint32_t seq, const trace_policy_t *policy, const reply_op_t is_reply)
|
||||
{
|
||||
char buf[TRACE_POLICY_BUF_SZ + 10];
|
||||
struct nlmsghdr *hdr = (struct nlmsghdr *)buf;
|
||||
|
@ -306,6 +306,7 @@ static trace_ret_t __policy_async_exec(const trace_policy_t *in,
|
|||
void *tmp_arg;
|
||||
struct sysinfo info;
|
||||
uint32_t seq, i;
|
||||
reply_op_t is_reply = REPLY_OP_NO_NEED;
|
||||
|
||||
seq = __sync_add_and_fetch(&g_sessionid, 1);
|
||||
SYSLOG_DEBUG("The seq of the message is %u", seq);
|
||||
|
@ -335,9 +336,11 @@ static trace_ret_t __policy_async_exec(const trace_policy_t *in,
|
|||
SYSLOG_ERR("cbarg which is been added is failure");
|
||||
goto END;
|
||||
}
|
||||
|
||||
is_reply = REPLY_OP_NEED;
|
||||
}
|
||||
|
||||
ret = cfg_channel_send(seq, in);
|
||||
ret = cfg_channel_send(seq, in, is_reply);
|
||||
if (ret != TRACE_SUCCESS) {
|
||||
SYSLOG_ERR("Sending cfg is failure");
|
||||
goto END;
|
||||
|
|
Loading…
Reference in New Issue