All of lore.kernel.org
 help / color / mirror / Atom feed
* ip6mr: Indentation not proper in ip6mr_cache_report()
@ 2021-09-08  2:25 Ujjal Roy
  2021-09-08 16:33 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Ujjal Roy @ 2021-09-08  2:25 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy
  Cc: Kernel, Kernel

[-- Attachment #1: Type: text/plain, Size: 371 bytes --]

Hi All,

Before sending the patch, I am writing this email to get your
attention please. As per my knowledge I can see ip6mr_cache_report()
has some indentation issues. Please have a look at the line 1085.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/ipv6/ip6mr.c#n1085

Sharing a patch based on the latest stable Linux.

Thanks,
UjjaL Roy

[-- Attachment #2: ip6mr-ip6mr_cache_report-indent-fix.patch --]
[-- Type: application/octet-stream, Size: 1462 bytes --]

diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 36ed9efb8825..aa5b884a819e 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1082,30 +1082,26 @@ static int ip6mr_cache_report(struct mr_table *mrt, struct sk_buff *pkt,
 	} else
 #endif
 	{
-	/*
-	 *	Copy the IP header
-	 */
+		/* Copy the IP header */
+		skb_put(skb, sizeof(struct ipv6hdr));
+		skb_reset_network_header(skb);
+		skb_copy_to_linear_data(skb, ipv6_hdr(pkt),
+					sizeof(struct ipv6hdr));
+
+		/* Add our header */
+		skb_put(skb, sizeof(*msg));
+		skb_reset_transport_header(skb);
+		msg = (struct mrt6msg *)skb_transport_header(skb);
 
-	skb_put(skb, sizeof(struct ipv6hdr));
-	skb_reset_network_header(skb);
-	skb_copy_to_linear_data(skb, ipv6_hdr(pkt), sizeof(struct ipv6hdr));
+		msg->im6_mbz = 0;
+		msg->im6_msgtype = assert;
+		msg->im6_mif = mifi;
+		msg->im6_pad = 0;
+		msg->im6_src = ipv6_hdr(pkt)->saddr;
+		msg->im6_dst = ipv6_hdr(pkt)->daddr;
 
-	/*
-	 *	Add our header
-	 */
-	skb_put(skb, sizeof(*msg));
-	skb_reset_transport_header(skb);
-	msg = (struct mrt6msg *)skb_transport_header(skb);
-
-	msg->im6_mbz = 0;
-	msg->im6_msgtype = assert;
-	msg->im6_mif = mifi;
-	msg->im6_pad = 0;
-	msg->im6_src = ipv6_hdr(pkt)->saddr;
-	msg->im6_dst = ipv6_hdr(pkt)->daddr;
-
-	skb_dst_set(skb, dst_clone(skb_dst(pkt)));
-	skb->ip_summed = CHECKSUM_UNNECESSARY;
+		skb_dst_set(skb, dst_clone(skb_dst(pkt)));
+		skb->ip_summed = CHECKSUM_UNNECESSARY;
 	}
 
 	rcu_read_lock();

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: ip6mr: Indentation not proper in ip6mr_cache_report()
  2021-09-08  2:25 ip6mr: Indentation not proper in ip6mr_cache_report() Ujjal Roy
@ 2021-09-08 16:33 ` Jakub Kicinski
  2021-09-09 12:28   ` Ujjal Roy
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2021-09-08 16:33 UTC (permalink / raw)
  To: Ujjal Roy; +Cc: David S. Miller, James Morris, Hideaki YOSHIFUJI, Kernel

On Wed, 8 Sep 2021 07:55:45 +0530 Ujjal Roy wrote:
> Hi All,
> 
> Before sending the patch, I am writing this email to get your
> attention please. As per my knowledge I can see ip6mr_cache_report()
> has some indentation issues. Please have a look at the line 1085.
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/ipv6/ip6mr.c#n1085
> 
> Sharing a patch based on the latest stable Linux.

Please repost with the patch being inline in the email.

Try to use git format-patch and git send-email for best results.

The subject prefix should be [PATCH net-next].

Regarding the change itself - since you're changing this code could you
also remove the ifdef? Instead of:

#ifdef CONFIG_IPV6_PIMSM_V2                                                     
        if (assert == MRT6MSG_WHOLEPKT) { 

do:

	if (IS_ENABLED(CONFIG_IPV6_PIMSM_V2) && assert == MRT6MSG_WHOLEPKT) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ip6mr: Indentation not proper in ip6mr_cache_report()
  2021-09-08 16:33 ` Jakub Kicinski
@ 2021-09-09 12:28   ` Ujjal Roy
  0 siblings, 0 replies; 3+ messages in thread
From: Ujjal Roy @ 2021-09-09 12:28 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: David S. Miller, James Morris, Hideaki YOSHIFUJI, Kernel

Thanks for the suggestion, I will do that change and will submit a patch.

Thanks,
UjjaL Roy

On Wed, Sep 8, 2021 at 10:03 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Wed, 8 Sep 2021 07:55:45 +0530 Ujjal Roy wrote:
> > Hi All,
> >
> > Before sending the patch, I am writing this email to get your
> > attention please. As per my knowledge I can see ip6mr_cache_report()
> > has some indentation issues. Please have a look at the line 1085.
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/ipv6/ip6mr.c#n1085
> >
> > Sharing a patch based on the latest stable Linux.
>
> Please repost with the patch being inline in the email.
>
> Try to use git format-patch and git send-email for best results.
>
> The subject prefix should be [PATCH net-next].
>
> Regarding the change itself - since you're changing this code could you
> also remove the ifdef? Instead of:
>
> #ifdef CONFIG_IPV6_PIMSM_V2
>         if (assert == MRT6MSG_WHOLEPKT) {
>
> do:
>
>         if (IS_ENABLED(CONFIG_IPV6_PIMSM_V2) && assert == MRT6MSG_WHOLEPKT) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-09 14:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08  2:25 ip6mr: Indentation not proper in ip6mr_cache_report() Ujjal Roy
2021-09-08 16:33 ` Jakub Kicinski
2021-09-09 12:28   ` Ujjal Roy

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.