Skip to contentSkip to conversation

bridge: fix endian

PATCH Applied [email protected] 3 participants 4 messages Jul 10, 2012 – Jul 11, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bridge: fix endian

From: Li RongQing <[email protected]>

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

CC YOSHIFUJI Hideaki <[email protected]>
---
 net/bridge/br_multicast.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/bridge/br_multicast.c +1 -1
index b665812..2d9a066 100644
@@ -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)) {
Signature · 1 line
1.7.1
#1 lore raw

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,

Quoted 30 lines · On Tue, Jul 10, 2012 at 3:26 PM, <[email protected]> wrote:

From: Li RongQing <[email protected]>

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

CC YOSHIFUJI Hideaki <[email protected]>
---
 net/bridge/br_multicast.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/bridge/br_multicast.c +1 -2
index b665812..2d9a066 100644
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

2012/7/10, devendra.aaru <[email protected]>:

Quoted 6 lines

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