fix invalid packet logging for icmpv6 conntrack
Subsystems (2)
cover fix invalid packet logging for icmpv6 conntrack
Hi,
This small patchset fixes a small issue with a nf_log_packet() message which was badly formatted and adds a message for invalid new icmpv6 packet.
Patchset statistic:
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)
BR,
--
Eric Leblond <[email protected]>
INL: http://www.inl.fr/
NuFW: http://www.nufw.org/
EdenWall: http://www.edenwall.com/
PATCH 1/2 netfilter: fix nf_log_packet message in icmpv6 conntrack.
This patch fixes a trivial typo that was adding a new line at end of the nf_log_packet() prefix. It also make the logging conditionnal by adding a LOG_INVALID test.
--- net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +3 -2
@@ -201,8 +201,9 @@ icmpv6_error(struct net *net, struct sk_buff *skb, unsigned int dataoff,if (net->ct.sysctl_checksum && hooknum ==NF_INET_PRE_ROUTING &&nf_ip6_checksum (skb, hooknum, dataoff,IPPROTO_ICMPV6 )) { -nf_log_packet (PF_INET6 ,0 , skb,NULL ,NULL ,NULL , -"nf_ct_icmpv6: ICMPv6 checksum failed\n" ); +if (LOG_INVALID (net,IPPROTO_ICMPV6 )) +nf_log_packet (PF_INET6 ,0 , skb,NULL ,NULL ,NULL , +"nf_ct_icmpv6: ICMPv6 checksum failed " );return -NF_ACCEPT ; }
Signature · 1 line
1.5.6.3
Patrick McHardy
AppliedRe: [PATCH 1/2] netfilter: fix nf_log_packet message in icmpv6 conntrack.
Quoted 3 lines · Eric Leblond
This patch fixes a trivial typo that was adding a new line at end of the
nf_log_packet()prefix. It also make the logging conditionnal by adding aLOG_INVALIDtest.
Applied, thanks Eric.
PATCH 2/2 netfilter: log invalid new icmpv6 packet with nf_log_packet().
In reply to Eric LeblondThis patch adds a logging message for invalid new icmpv6 packet.
--- net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +4 -0
@@ -126,6 +126,10 @@ static bool icmpv6_new(struct nf_conn *ct, const struct sk_buff *skb,pr_debug ("icmpv6: can't create new conn with type %u\n" , type +128 );nf_ct_dump_tuple_ipv6 (&ct->tuplehash[0 ].tuple); +if (LOG_INVALID (&init_net,IPPROTO_ICMPV6 )) +nf_log_packet (PF_INET6 ,0 , skb,NULL ,NULL ,NULL , +"nf_ct_icmpv6: invalid new with type %d " , + type +128 );return false; }atomic_set (&ct->proto.icmp.count,0 );
Signature · 1 line
1.5.6.3
Re: [PATCH 2/2] netfilter: log invalid new icmpv6 packet with nf_log_packet().
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c static bool icmpv6_new(struct nf_conn *ct, const struct sk_buff *skb, · line 129
Quoted 7 lines · Eric Leblond
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +1
-0@@ -126,6 +126,10 @@ static bool icmpv6_new(struct nf_conn *ct, const struct sk_buff *skb,pr_debug ("icmpv6: can't create new conn with type %u\n" , type +128 );nf_ct_dump_tuple_ipv6 (&ct->tuplehash[0 ].tuple); +if (LOG_INVALID (&init_net,IPPROTO_ICMPV6 ))
netns is nf_ct_net(ct) at this point, not &init_net.
Quoted 3 lines
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +3
-0+nf_log_packet (PF_INET6 ,0 , skb,NULL ,NULL ,NULL , +"nf_ct_icmpv6: invalid new with type %d " , + type +128 );
Re: [PATCH 2/2] netfilter: log invalid new icmpv6 packet with nf_log_packet().
Hi,
Quoted 10 lines · Alexey Dobriyan
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c static bool icmpv6_new(struct nf_conn *ct, const struct sk_buff *skb, · line 129
Quoted 7 lines · Eric Leblond
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +1
-0@@ -126,6 +126,10 @@ static bool icmpv6_new(struct nf_conn *ct, const struct sk_buff *skb,pr_debug ("icmpv6: can't create new conn with type %u\n" , type +128 );nf_ct_dump_tuple_ipv6 (&ct->tuplehash[0 ].tuple); +if (LOG_INVALID (&init_net,IPPROTO_ICMPV6 ))netns is
nf_ct_net(ct)at this point, not&init_net.
Thanks a lot, updated patch to follow.
BR,
--
Eric Leblond <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/1 netfilter: log invalid new icmpv6 packet with nf_log_packet().
This patch adds a logging message for invalid new icmpv6 packet.
--- net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +4 -0
@@ -126,6 +126,10 @@ static bool icmpv6_new(struct nf_conn *ct, const struct sk_buff *skb,pr_debug ("icmpv6: can't create new conn with type %u\n" , type +128 );nf_ct_dump_tuple_ipv6 (&ct->tuplehash[0 ].tuple); +if (LOG_INVALID (nf_ct_net (ct),IPPROTO_ICMPV6 )) +nf_log_packet (PF_INET6 ,0 , skb,NULL ,NULL ,NULL , +"nf_ct_icmpv6: invalid new with type %d " , + type +128 );return false; }atomic_set (&ct->proto.icmp.count,0 );
Signature · 1 line
1.5.6.3
Re: [PATCH] netfilter: log invalid new icmpv6 packet with nf_log_packet().
Quoted 1 line · Eric Leblond
This patch adds a logging message for invalid new icmpv6 packet.
I've queued this one for 2.6.30 since its not really a fix. Thanks.