浏览代码

[IPV4]: mroute annotations

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Al Viro 18 年之前
父节点
当前提交
114c7844f3
共有 2 个文件被更改,包括 7 次插入7 次删除
  1. 5 5
      include/linux/mroute.h
  2. 2 2
      net/ipv4/ipmr.c

+ 5 - 5
include/linux/mroute.h

@@ -142,7 +142,7 @@ struct vif_device
 	unsigned long	rate_limit;		/* Traffic shaping (NI) 	*/
 	unsigned long	rate_limit;		/* Traffic shaping (NI) 	*/
 	unsigned char	threshold;		/* TTL threshold 		*/
 	unsigned char	threshold;		/* TTL threshold 		*/
 	unsigned short	flags;			/* Control flags 		*/
 	unsigned short	flags;			/* Control flags 		*/
-	__u32		local,remote;		/* Addresses(remote for tunnels)*/
+	__be32		local,remote;		/* Addresses(remote for tunnels)*/
 	int		link;			/* Physical interface index	*/
 	int		link;			/* Physical interface index	*/
 };
 };
 
 
@@ -151,8 +151,8 @@ struct vif_device
 struct mfc_cache 
 struct mfc_cache 
 {
 {
 	struct mfc_cache *next;			/* Next entry on cache line 	*/
 	struct mfc_cache *next;			/* Next entry on cache line 	*/
-	__u32 mfc_mcastgrp;			/* Group the entry belongs to 	*/
-	__u32 mfc_origin;			/* Source of packet 		*/
+	__be32 mfc_mcastgrp;			/* Group the entry belongs to 	*/
+	__be32 mfc_origin;			/* Source of packet 		*/
 	vifi_t mfc_parent;			/* Source interface		*/
 	vifi_t mfc_parent;			/* Source interface		*/
 	int mfc_flags;				/* Flags on line		*/
 	int mfc_flags;				/* Flags on line		*/
 
 
@@ -179,9 +179,9 @@ struct mfc_cache
 #define MFC_LINES		64
 #define MFC_LINES		64
 
 
 #ifdef __BIG_ENDIAN
 #ifdef __BIG_ENDIAN
-#define MFC_HASH(a,b)	((((a)>>24)^((b)>>26))&(MFC_LINES-1))
+#define MFC_HASH(a,b)	(((((__force u32)(__be32)a)>>24)^(((__force u32)(__be32)b)>>26))&(MFC_LINES-1))
 #else
 #else
-#define MFC_HASH(a,b)	(((a)^((b)>>2))&(MFC_LINES-1))
+#define MFC_HASH(a,b)	((((__force u32)(__be32)a)^(((__force u32)(__be32)b)>>2))&(MFC_LINES-1))
 #endif		
 #endif		
 
 
 #endif
 #endif

+ 2 - 2
net/ipv4/ipmr.c

@@ -462,7 +462,7 @@ static int vif_add(struct vifctl *vifc, int mrtsock)
 	return 0;
 	return 0;
 }
 }
 
 
-static struct mfc_cache *ipmr_cache_find(__u32 origin, __u32 mcastgrp)
+static struct mfc_cache *ipmr_cache_find(__be32 origin, __be32 mcastgrp)
 {
 {
 	int line=MFC_HASH(mcastgrp,origin);
 	int line=MFC_HASH(mcastgrp,origin);
 	struct mfc_cache *c;
 	struct mfc_cache *c;
@@ -1097,7 +1097,7 @@ static struct notifier_block ip_mr_notifier={
  *	important for multicast video.
  *	important for multicast video.
  */
  */
  
  
-static void ip_encap(struct sk_buff *skb, u32 saddr, u32 daddr)
+static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr)
 {
 {
 	struct iphdr *iph = (struct iphdr *)skb_push(skb,sizeof(struct iphdr));
 	struct iphdr *iph = (struct iphdr *)skb_push(skb,sizeof(struct iphdr));