From: Patrick McHardy <kaber@trash.net>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: Netfilter Developer Mailing List <netfilter-devel@lists.netfilter.org>
Subject: Re: [PATCH 1/3] Misc cleanups
Date: Mon, 11 Jun 2007 16:17:14 +0200 [thread overview]
Message-ID: <466D596A.20807@trash.net> (raw)
In-Reply-To: <Pine.LNX.4.61.0706042109390.20829@yvahk01.tjqt.qr>
Jan Engelhardt wrote:
> Make a number of variables const and/or remove unneeded casts.
Applied with some minor changes, thanks Jan.
> @@ -249,7 +249,7 @@ clusterip_hashfn(struct sk_buff *skb, st
> case IPPROTO_SCTP:
> case IPPROTO_DCCP:
> case IPPROTO_ICMP:
> - ports = (void *)iph+iph->ihl*4;
> + ports = (const void *)iph+iph->ihl*4;
This one is not neccessary.
> @@ -88,7 +88,7 @@ masquerade_target(struct sk_buff **pskb,
> return NF_ACCEPT;
>
> mr = targinfo;
> - rt = (struct rtable *)(*pskb)->dst;
> + rt = (const struct rtable *)(*pskb)->dst;
This one neither.
> @@ -147,7 +147,8 @@ static int masq_inet_event(struct notifi
> unsigned long event,
> void *ptr)
> {
> - struct net_device *dev = ((struct in_ifaddr *)ptr)->ifa_dev->dev;
> + const struct net_device *dev =
> + ((const struct in_ifaddr *)ptr)->ifa_dev->dev;
Same here.
> +++ linux-2.6.22-rc3-git6/net/ipv4/netfilter/ipt_TOS.c
> @@ -50,7 +50,8 @@ checkentry(const char *tablename,
> void *targinfo,
> unsigned int hook_mask)
> {
> - const u_int8_t tos = ((struct ipt_tos_target_info *)targinfo)->tos;
> + const u_int8_t tos =
> + ((const struct ipt_tos_target_info *)targinfo)->tos;
And here.
> @@ -443,8 +449,8 @@ hashlimit_match(const struct sk_buff *sk
> unsigned int protoff,
> bool *hotdrop)
> {
> - struct xt_hashlimit_info *r =
> - ((struct xt_hashlimit_info *)matchinfo)->u.master;
> + const struct xt_hashlimit_info *r =
> + ((const struct xt_hashlimit_info *)matchinfo)->u.master;
This one is fine I guess since matchinfo is also const. Same for
all other matches.
next prev parent reply other threads:[~2007-06-11 14:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-04 19:09 [PATCH 0/3] Misc cleanups Jan Engelhardt
2007-06-04 19:11 ` [PATCH 1/3] " Jan Engelhardt
2007-06-11 14:17 ` Patrick McHardy [this message]
2007-06-11 14:31 ` Jan Engelhardt
2007-06-11 14:34 ` Patrick McHardy
2007-06-04 19:13 ` [PATCH 2/3] " Jan Engelhardt
2007-06-11 14:18 ` Patrick McHardy
2007-06-04 19:14 ` [PATCH 3/3] " Jan Engelhardt
2007-06-11 14:30 ` Patrick McHardy
2007-06-06 16:11 ` [PATCH 0/3] " Patrick McHardy
2007-06-07 6:56 ` Jan Engelhardt
2007-06-07 8:26 ` Jan Engelhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=466D596A.20807@trash.net \
--to=kaber@trash.net \
--cc=jengelh@linux01.gwdg.de \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.