* patch for format issues and header bug in net/ipv4/icmp.c
@ 2011-03-18 18:35 Jeffrin Jose
2011-03-18 19:41 ` Ben Hutchings
0 siblings, 1 reply; 3+ messages in thread
From: Jeffrin Jose @ 2011-03-18 18:35 UTC (permalink / raw)
To: David S. Miller, Alexey Kuznetsov; +Cc: linux-kernel, netdev
[-- Attachment #1: Type: text/plain, Size: 277 bytes --]
hello ,
I have created a patch for net/ipv4/icmp.c
using checkpatch.pl script to fix several warnings
and an error.
I have attached the patch along with this mail.
/Thanks
--
software engineer.
department of computer science
rajagiri school of engineering and technology.
[-- Attachment #2: 0001-net-Fixed-format-issues-and-header-bug-in-net-ipv4-i.patch --]
[-- Type: text/x-diff, Size: 4317 bytes --]
>From 01861eb7151d397d10e1e8be58ac79252b04e254 Mon Sep 17 00:00:00 2001
From: Jeffrin Jose <ahiliation@yahoo.co.in>
Date: Fri, 18 Mar 2011 23:20:24 +0530
Subject: [PATCH] net : Fixed format issues and header bug in net/ipv4/icmp.c
This is a patch to net/ipv4/icmp.c file that fixes several
line limit and several format ones and also a header path
issue found by the checkpatch.pl tool.
Author: Jeffrin Jose <ahiliation@yahoo.co.in>
Signed-off-by: Jeffrin Jose
---
net/ipv4/icmp.c | 30 +++++++++++++++++-------------
1 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index a91dc16..348cc17 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -53,7 +53,7 @@
* - ICMP header length was not accounted
* at all.
* Tristan Greaves : Added sysctl option to ignore bogus
- * broadcast responses from broken routers.
+ * broadcast responses from broken routers.
*
* To Fix:
*
@@ -89,7 +89,7 @@
#include <linux/timer.h>
#include <linux/init.h>
#include <asm/system.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
#include <net/checksum.h>
#include <net/xfrm.h>
#include <net/inet_common.h>
@@ -113,7 +113,8 @@ struct icmp_bxm {
};
/* An array of errno for error messages from dest unreach. */
-/* RFC 1122: 3.2.2.1 States that NET_UNREACH, HOST_UNREACH and SR_FAILED MUST be considered 'transient errs'. */
+/* RFC 1122: 3.2.2.1 States that NET_UNREACH, HOST_UNREACH and SR_FAILED MUST
+be considered 'transient errs'. */
const struct icmp_err icmp_err_convert[] = {
{
@@ -303,7 +304,7 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param,
ipc, rt, MSG_DONTWAIT) < 0) {
ICMP_INC_STATS_BH(sock_net(sk), ICMP_MIB_OUTERRORS);
ip_flush_pending_frames(sk);
- } else if ((skb = skb_peek(&sk->sk_write_queue)) != NULL) {
+ } else if ((skb == skb_peek(&sk->sk_write_queue)) != NULL) {
struct icmphdr *icmph = icmp_hdr(skb);
__wsum csum = 0;
struct sk_buff *skb1;
@@ -411,7 +412,8 @@ static struct rtable *icmp_route_lookup(struct net *net, struct sk_buff *skb_in,
} else
return rt;
- err = xfrm_decode_session_reverse(skb_in, flowi4_to_flowi(&fl4), AF_INET);
+ err = xfrm_decode_session_reverse(skb_in, \
+ flowi4_to_flowi(&fl4), AF_INET);
if (err)
goto relookup_failed;
@@ -648,7 +650,7 @@ static void icmp_unreach(struct sk_buff *skb)
/*
* Incomplete header ?
- * Only checks for the IP header, there should be an
+ * Only checks for the IP header, there should be an
* additional check for longer headers in upper levels.
*/
@@ -670,18 +672,20 @@ static void icmp_unreach(struct sk_buff *skb)
break;
case ICMP_FRAG_NEEDED:
if (ipv4_config.no_pmtu_disc) {
- LIMIT_NETDEBUG(KERN_INFO "ICMP: %pI4: fragmentation needed and DF set.\n",
+ LIMIT_NETDEBUG(KERN_INFO "ICMP: %pI4: \
+ fragmentation needed and DF set.\n",
&iph->daddr);
} else {
info = ip_rt_frag_needed(net, iph,
- ntohs(icmph->un.frag.mtu),
+ ntohs(icmph->un.frag.mtu),
skb->dev);
if (!info)
goto out;
}
break;
case ICMP_SR_FAILED:
- LIMIT_NETDEBUG(KERN_INFO "ICMP: %pI4: Source Route Failed.\n",
+ LIMIT_NETDEBUG(KERN_INFO "ICMP: %pI4: \
+ Source Route Failed.\n",
&iph->daddr);
break;
default:
@@ -875,7 +879,7 @@ out_err:
*
* RFC1812 (4.3.3.9). A router MUST implement it.
* A router SHOULD have switch turning it on/off.
- * This switch MUST be ON by default.
+ * This switch MUST be ON by default.
*
* Gratuitous replies, zero-source replies are not implemented,
* that complies with RFC. DO NOT implement them!!! All the idea
@@ -1163,7 +1167,7 @@ static int __net_init icmp_sk_init(struct net *net)
net->ipv4.sysctl_icmp_ignore_bogus_error_responses = 1;
/*
- * Configurable global rate limit.
+ * Configurable global rate limit.
*
* ratelimit defines tokens/packet consumed for dst->rate_token
* bucket ratemask defines which icmp types are ratelimited by
@@ -1188,8 +1192,8 @@ fail:
}
static struct pernet_operations __net_initdata icmp_sk_ops = {
- .init = icmp_sk_init,
- .exit = icmp_sk_exit,
+ .init = icmp_sk_init,
+ .exit = icmp_sk_exit,
};
int __init icmp_init(void)
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: patch for format issues and header bug in net/ipv4/icmp.c
2011-03-18 18:35 patch for format issues and header bug in net/ipv4/icmp.c Jeffrin Jose
@ 2011-03-18 19:41 ` Ben Hutchings
2011-03-18 19:57 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Ben Hutchings @ 2011-03-18 19:41 UTC (permalink / raw)
To: Jeffrin Jose; +Cc: David S. Miller, Alexey Kuznetsov, linux-kernel, netdev
On Sat, 2011-03-19 at 00:05 +0530, Jeffrin Jose wrote:
> hello ,
>
> I have created a patch for net/ipv4/icmp.c
> using checkpatch.pl script to fix several warnings
> and an error.
You need to learn C programming before trying to correct C programs.
You should not just do what it takes to make checkpatch.pl happy.
Ben.
> I have attached the patch along with this mail.
>
> /Thanks
>
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: patch for format issues and header bug in net/ipv4/icmp.c
2011-03-18 19:41 ` Ben Hutchings
@ 2011-03-18 19:57 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2011-03-18 19:57 UTC (permalink / raw)
To: bhutchings; +Cc: ahiliation, kuznet, linux-kernel, netdev
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Fri, 18 Mar 2011 19:41:01 +0000
> On Sat, 2011-03-19 at 00:05 +0530, Jeffrin Jose wrote:
>> hello ,
>>
>> I have created a patch for net/ipv4/icmp.c
>> using checkpatch.pl script to fix several warnings
>> and an error.
>
> You need to learn C programming before trying to correct C programs.
> You should not just do what it takes to make checkpatch.pl happy.
I completely agree, and I absolutely refuse to apply this patch.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-03-18 19:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-18 18:35 patch for format issues and header bug in net/ipv4/icmp.c Jeffrin Jose
2011-03-18 19:41 ` Ben Hutchings
2011-03-18 19:57 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).