Loading include/linux/inetdevice.h +8 −6 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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); } Loading include/net/arp.h +1 −1 Original line number Diff line number Diff line Loading @@ -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, Loading include/net/ip.h +6 −5 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading @@ -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 */ Loading net/ipv4/af_inet.c +3 −3 Original line number Diff line number Diff line Loading @@ -644,7 +644,7 @@ int inet_getname(struct socket *sock, struct sockaddr *uaddr, sin->sin_port = inet->dport; sin->sin_addr.s_addr = inet->daddr; } else { __u32 addr = inet->rcv_saddr; __be32 addr = inet->rcv_saddr; if (!addr) addr = inet->saddr; sin->sin_port = inet->sport; Loading Loading @@ -995,8 +995,8 @@ static int inet_sk_reselect_saddr(struct sock *sk) struct inet_sock *inet = inet_sk(sk); int err; struct rtable *rt; __u32 old_saddr = inet->saddr; __u32 new_saddr; __be32 old_saddr = inet->saddr; __be32 new_saddr; __be32 daddr = inet->daddr; if (inet->opt && inet->opt->srr) Loading net/ipv4/arp.c +1 −1 Original line number Diff line number Diff line Loading @@ -203,7 +203,7 @@ struct neigh_table arp_tbl = { .gc_thresh3 = 1024, }; int arp_mc_map(u32 addr, u8 *haddr, struct net_device *dev, int dir) int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir) { switch (dev->type) { case ARPHRD_ETHER: Loading Loading
include/linux/inetdevice.h +8 −6 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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); } Loading
include/net/arp.h +1 −1 Original line number Diff line number Diff line Loading @@ -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, Loading
include/net/ip.h +6 −5 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading @@ -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 */ Loading
net/ipv4/af_inet.c +3 −3 Original line number Diff line number Diff line Loading @@ -644,7 +644,7 @@ int inet_getname(struct socket *sock, struct sockaddr *uaddr, sin->sin_port = inet->dport; sin->sin_addr.s_addr = inet->daddr; } else { __u32 addr = inet->rcv_saddr; __be32 addr = inet->rcv_saddr; if (!addr) addr = inet->saddr; sin->sin_port = inet->sport; Loading Loading @@ -995,8 +995,8 @@ static int inet_sk_reselect_saddr(struct sock *sk) struct inet_sock *inet = inet_sk(sk); int err; struct rtable *rt; __u32 old_saddr = inet->saddr; __u32 new_saddr; __be32 old_saddr = inet->saddr; __be32 new_saddr; __be32 daddr = inet->daddr; if (inet->opt && inet->opt->srr) Loading
net/ipv4/arp.c +1 −1 Original line number Diff line number Diff line Loading @@ -203,7 +203,7 @@ struct neigh_table arp_tbl = { .gc_thresh3 = 1024, }; int arp_mc_map(u32 addr, u8 *haddr, struct net_device *dev, int dir) int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir) { switch (dev->type) { case ARPHRD_ETHER: Loading