diff mbox

bridge: fix endian

Message ID 1341914172-22075-1-git-send-email-roy.qing.li@gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Li RongQing July 10, 2012, 9:56 a.m. UTC
From: Li RongQing <roy.qing.li@gmail.com>

mld->mld_maxdelay is net endian, so we should use ntohs, not htons

CC: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
 net/bridge/br_multicast.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Devendra Naga July 10, 2012, 10:04 a.m. UTC | #1
As you are doing the same change to the drivers in drivers/net/*** i
think a patchset would be better.

but that's just upto you. ;-)

Thanks,

On Tue, Jul 10, 2012 at 3:26 PM,  <roy.qing.li@gmail.com> wrote:
> From: Li RongQing <roy.qing.li@gmail.com>
>
> mld->mld_maxdelay is net endian, so we should use ntohs, not htons
>
> CC: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
> ---
>  net/bridge/br_multicast.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
> index b665812..2d9a066 100644
> --- a/net/bridge/br_multicast.c
> +++ b/net/bridge/br_multicast.c
> @@ -1160,7 +1160,7 @@ static int br_ip6_multicast_query(struct net_bridge *br,
>                         goto out;
>                 }
>                 mld = (struct mld_msg *) icmp6_hdr(skb);
> -               max_delay = msecs_to_jiffies(htons(mld->mld_maxdelay));
> +               max_delay = msecs_to_jiffies(ntohs(mld->mld_maxdelay));
>                 if (max_delay)
>                         group = &mld->mld_mca;
>         } else if (skb->len >= sizeof(*mld2q)) {
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Li RongQing July 10, 2012, 2 p.m. UTC | #2
2012/7/10, devendra.aaru <devendra.aaru@gmail.com>:
> As you are doing the same change to the drivers in drivers/net/*** i
> think a patchset would be better.
>
> but that's just upto you. ;-)
>
> Thanks,

If I can find others afterward, I will change them on a patchset.
Thanks

-Roy
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller July 11, 2012, 8:32 a.m. UTC | #3
From: roy.qing.li@gmail.com
Date: Tue, 10 Jul 2012 17:56:12 +0800

> From: Li RongQing <roy.qing.li@gmail.com>
> 
> mld->mld_maxdelay is net endian, so we should use ntohs, not htons
> 
> CC: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index b665812..2d9a066 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1160,7 +1160,7 @@  static int br_ip6_multicast_query(struct net_bridge *br,
 			goto out;
 		}
 		mld = (struct mld_msg *) icmp6_hdr(skb);
-		max_delay = msecs_to_jiffies(htons(mld->mld_maxdelay));
+		max_delay = msecs_to_jiffies(ntohs(mld->mld_maxdelay));
 		if (max_delay)
 			group = &mld->mld_mca;
 	} else if (skb->len >= sizeof(*mld2q)) {