Skip to content

Commit bea588b

Browse files
TaeheeYooummakynes
authored andcommitted
netfilter: nf_nat_snmp_basic: use nf_ct_helper_log
Use nf_ct_helper_log to write log message. Signed-off-by: Taehee Yoo <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 8b8f081 commit bea588b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

net/ipv4/netfilter/nf_nat_snmp_basic.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ static int snmp_translate(struct nf_conn *ct, int dir, struct sk_buff *skb)
11091109

11101110
if (!snmp_parse_mangle((unsigned char *)udph + sizeof(struct udphdr),
11111111
paylen, &map, &udph->check)) {
1112-
net_warn_ratelimited("bsalg: parser failed\n");
1112+
nf_ct_helper_log(skb, ct, "parser failed\n");
11131113
return NF_DROP;
11141114
}
11151115
return NF_ACCEPT;
@@ -1143,13 +1143,14 @@ static int help(struct sk_buff *skb, unsigned int protoff,
11431143
* can mess around with the payload.
11441144
*/
11451145
if (ntohs(udph->len) != skb->len - (iph->ihl << 2)) {
1146-
net_warn_ratelimited("SNMP: dropping malformed packet src=%pI4 dst=%pI4\n",
1147-
&iph->saddr, &iph->daddr);
1148-
return NF_DROP;
1146+
nf_ct_helper_log(skb, ct, "dropping malformed packet\n");
1147+
return NF_DROP;
11491148
}
11501149

1151-
if (!skb_make_writable(skb, skb->len))
1150+
if (!skb_make_writable(skb, skb->len)) {
1151+
nf_ct_helper_log(skb, ct, "cannot mangle packet");
11521152
return NF_DROP;
1153+
}
11531154

11541155
spin_lock_bh(&snmp_lock);
11551156
ret = snmp_translate(ct, dir, skb);

0 commit comments

Comments
 (0)