MOD aaa-12 代码优化
SOL 修改人:gechangwei 检视人:gechangwei Signed-off-by: gechangwei <gechangwei@cmhi.chinamobile.com>
This commit is contained in:
parent
c0c1ac9c92
commit
e52e2bc5b4
|
@ -153,9 +153,9 @@ int debugfs_prk_onoff(struct netlinkk_cfg *g_nlcfg, struct nlmsghdr *nlh,struct
|
||||||
unsigned char * cookies = "test cookies";
|
unsigned char * cookies = "test cookies";
|
||||||
int err, len = 0;
|
int err, len = 0;
|
||||||
|
|
||||||
char *pload;
|
char *pload = NULL;
|
||||||
struct nlattr *rta;
|
struct nlattr *rta = NULL;
|
||||||
char* load;
|
char* load = NULL;
|
||||||
unsigned long fk_type;
|
unsigned long fk_type;
|
||||||
|
|
||||||
pload = nlmsg_data(nlh);
|
pload = nlmsg_data(nlh);
|
||||||
|
@ -218,12 +218,12 @@ int debugfs_pkt_num_stati_witisend(struct netlinkk_cfg *g_nlcfg,
|
||||||
struct nlmsghdr *nlh,struct commnl_msgtype_process* msg_process)
|
struct nlmsghdr *nlh,struct commnl_msgtype_process* msg_process)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
struct sk_buff *out_skb;
|
struct sk_buff *out_skb = NULL;
|
||||||
struct nlmsghdr *out_nlh;
|
struct nlmsghdr *out_nlh = NULL;
|
||||||
unsigned int length = sizeof(struct netlink_debugfs);
|
unsigned int length = sizeof(struct netlink_debugfs);
|
||||||
char *pload;
|
char *pload = NULL;
|
||||||
struct nlattr *rta;
|
struct nlattr *rta = NULL;
|
||||||
char* load;
|
char* load = NULL;
|
||||||
unsigned long fk_type;
|
unsigned long fk_type;
|
||||||
struct netlink_debugfs * tmp_dfs = NULL;
|
struct netlink_debugfs * tmp_dfs = NULL;
|
||||||
|
|
||||||
|
|
|
@ -204,10 +204,10 @@ unsigned int pdelivery_hook_func(void *priv,
|
||||||
struct sk_buff *skb,
|
struct sk_buff *skb,
|
||||||
const struct nf_hook_state *state)
|
const struct nf_hook_state *state)
|
||||||
{
|
{
|
||||||
void *payload;
|
void *payload = NULL;
|
||||||
struct sk_buff *out_skb;
|
struct sk_buff *out_skb = NULL;
|
||||||
void *out_payload;
|
void *out_payload = NULL;
|
||||||
struct nlmsghdr *out_nlh;
|
struct nlmsghdr *out_nlh = NULL;
|
||||||
int payload_len; // with padding, but ok for echo
|
int payload_len; // with padding, but ok for echo
|
||||||
//struct iphdr *iph;
|
//struct iphdr *iph;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
@ -224,7 +224,7 @@ unsigned int pdelivery_hook_func(void *priv,
|
||||||
payload_len = skb->len + skb->mac_len;/**/
|
payload_len = skb->len + skb->mac_len;/**/
|
||||||
|
|
||||||
|
|
||||||
out_skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); //分配足以存放默认大小的sk_buff
|
out_skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); //分配足以存放默认大小的sk_buff
|
||||||
if (!out_skb)
|
if (!out_skb)
|
||||||
{
|
{
|
||||||
goto failure;
|
goto failure;
|
||||||
|
|
Loading…
Reference in New Issue