You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[IPV6]: Assorted trivial endianness annotations.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -124,12 +124,13 @@ static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa)
|
||||
* Check if a mask is acceptable.
|
||||
*/
|
||||
|
||||
static __inline__ int bad_mask(u32 mask, u32 addr)
|
||||
static __inline__ int bad_mask(__be32 mask, __be32 addr)
|
||||
{
|
||||
__u32 hmask;
|
||||
if (addr & (mask = ~mask))
|
||||
return 1;
|
||||
mask = ntohl(mask);
|
||||
if (mask & (mask+1))
|
||||
hmask = ntohl(mask);
|
||||
if (hmask & (hmask+1))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
@@ -190,11 +191,12 @@ static __inline__ __be32 inet_make_mask(int logmask)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static __inline__ int inet_mask_len(__u32 mask)
|
||||
static __inline__ int inet_mask_len(__be32 mask)
|
||||
{
|
||||
if (!(mask = ntohl(mask)))
|
||||
__u32 hmask = ntohl(mask);
|
||||
if (!hmask)
|
||||
return 0;
|
||||
return 32 - ffz(~mask);
|
||||
return 32 - ffz(~hmask);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ extern void arp_send(int type, int ptype, __be32 dest_ip,
|
||||
struct net_device *dev, __be32 src_ip,
|
||||
unsigned char *dest_hw, unsigned char *src_hw, unsigned char *th);
|
||||
extern int arp_bind_neighbour(struct dst_entry *dst);
|
||||
extern int arp_mc_map(u32 addr, u8 *haddr, struct net_device *dev, int dir);
|
||||
extern int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir);
|
||||
extern void arp_ifdown(struct net_device *dev);
|
||||
|
||||
extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
|
||||
|
||||
+6
-5
@@ -123,7 +123,7 @@ extern int ip4_datagram_connect(struct sock *sk,
|
||||
* multicast packets.
|
||||
*/
|
||||
|
||||
static inline void ip_tr_mc_map(u32 addr, char *buf)
|
||||
static inline void ip_tr_mc_map(__be32 addr, char *buf)
|
||||
{
|
||||
buf[0]=0xC0;
|
||||
buf[1]=0x00;
|
||||
@@ -238,9 +238,9 @@ static inline void ip_select_ident_more(struct iphdr *iph, struct dst_entry *dst
|
||||
* Map a multicast IP onto multicast MAC for type ethernet.
|
||||
*/
|
||||
|
||||
static inline void ip_eth_mc_map(u32 addr, char *buf)
|
||||
static inline void ip_eth_mc_map(__be32 naddr, char *buf)
|
||||
{
|
||||
addr=ntohl(addr);
|
||||
__u32 addr=ntohl(naddr);
|
||||
buf[0]=0x01;
|
||||
buf[1]=0x00;
|
||||
buf[2]=0x5e;
|
||||
@@ -256,13 +256,14 @@ static inline void ip_eth_mc_map(u32 addr, char *buf)
|
||||
* Leave P_Key as 0 to be filled in by driver.
|
||||
*/
|
||||
|
||||
static inline void ip_ib_mc_map(u32 addr, char *buf)
|
||||
static inline void ip_ib_mc_map(__be32 naddr, char *buf)
|
||||
{
|
||||
__u32 addr;
|
||||
buf[0] = 0; /* Reserved */
|
||||
buf[1] = 0xff; /* Multicast QPN */
|
||||
buf[2] = 0xff;
|
||||
buf[3] = 0xff;
|
||||
addr = ntohl(addr);
|
||||
addr = ntohl(naddr);
|
||||
buf[4] = 0xff;
|
||||
buf[5] = 0x12; /* link local scope */
|
||||
buf[6] = 0x40; /* IPv4 signature */
|
||||
|
||||
Reference in New Issue
Block a user