Skip to content

Commit ed9bad0

Browse files
Al ViroDavid S. Miller
authored andcommitted
[IPV4] net/ipv4/arp.c: trivial annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent bd6d610 commit ed9bad0

3 files changed

Lines changed: 20 additions & 20 deletions

File tree

‎include/net/arp.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ extern struct neigh_table arp_tbl;
1212
extern void arp_init(void);
1313
extern int arp_find(unsigned char *haddr, struct sk_buff *skb);
1414
extern int arp_ioctl(unsigned int cmd, void __user *arg);
15-
extern void arp_send(int type, int ptype, u32 dest_ip,
16-
struct net_device *dev, u32 src_ip,
15+
extern void arp_send(int type, int ptype, __be32 dest_ip,
16+
struct net_device *dev, __be32 src_ip,
1717
unsigned char *dest_hw, unsigned char *src_hw, unsigned char *th);
1818
extern int arp_bind_neighbour(struct dst_entry *dst);
1919
extern int arp_mc_map(u32 addr, u8 *haddr, struct net_device *dev, int dir);
2020
extern void arp_ifdown(struct net_device *dev);
2121

22-
extern struct sk_buff *arp_create(int type, int ptype, u32 dest_ip,
23-
struct net_device *dev, u32 src_ip,
22+
extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
23+
struct net_device *dev, __be32 src_ip,
2424
unsigned char *dest_hw, unsigned char *src_hw,
2525
unsigned char *target_hw);
2626
extern void arp_xmit(struct sk_buff *skb);

‎net/bridge/netfilter/ebt_arpreply.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static int ebt_target_reply(struct sk_buff **pskb, unsigned int hooknr,
2020
const void *data, unsigned int datalen)
2121
{
2222
struct ebt_arpreply_info *info = (struct ebt_arpreply_info *)data;
23-
u32 _sip, *siptr, _dip, *diptr;
23+
__be32 _sip, *siptr, _dip, *diptr;
2424
struct arphdr _ah, *ap;
2525
unsigned char _sha[ETH_ALEN], *shp;
2626
struct sk_buff *skb = *pskb;

‎net/ipv4/arp.c‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb)
385385
}
386386

387387
static int arp_ignore(struct in_device *in_dev, struct net_device *dev,
388-
u32 sip, u32 tip)
388+
__be32 sip, __be32 tip)
389389
{
390390
int scope;
391391

@@ -420,7 +420,7 @@ static int arp_ignore(struct in_device *in_dev, struct net_device *dev,
420420
return !inet_confirm_addr(dev, sip, tip, scope);
421421
}
422422

423-
static int arp_filter(__u32 sip, __u32 tip, struct net_device *dev)
423+
static int arp_filter(__be32 sip, __be32 tip, struct net_device *dev)
424424
{
425425
struct flowi fl = { .nl_u = { .ip4_u = { .daddr = sip,
426426
.saddr = tip } } };
@@ -449,7 +449,7 @@ static int arp_filter(__u32 sip, __u32 tip, struct net_device *dev)
449449
* is allowed to use this function, it is scheduled to be removed. --ANK
450450
*/
451451

452-
static int arp_set_predefined(int addr_hint, unsigned char * haddr, u32 paddr, struct net_device * dev)
452+
static int arp_set_predefined(int addr_hint, unsigned char * haddr, __be32 paddr, struct net_device * dev)
453453
{
454454
switch (addr_hint) {
455455
case RTN_LOCAL:
@@ -511,7 +511,7 @@ int arp_bind_neighbour(struct dst_entry *dst)
511511
if (dev == NULL)
512512
return -EINVAL;
513513
if (n == NULL) {
514-
u32 nexthop = ((struct rtable*)dst)->rt_gateway;
514+
__be32 nexthop = ((struct rtable*)dst)->rt_gateway;
515515
if (dev->flags&(IFF_LOOPBACK|IFF_POINTOPOINT))
516516
nexthop = 0;
517517
n = __neigh_lookup_errno(
@@ -560,8 +560,8 @@ static inline int arp_fwd_proxy(struct in_device *in_dev, struct rtable *rt)
560560
* Create an arp packet. If (dest_hw == NULL), we create a broadcast
561561
* message.
562562
*/
563-
struct sk_buff *arp_create(int type, int ptype, u32 dest_ip,
564-
struct net_device *dev, u32 src_ip,
563+
struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
564+
struct net_device *dev, __be32 src_ip,
565565
unsigned char *dest_hw, unsigned char *src_hw,
566566
unsigned char *target_hw)
567567
{
@@ -675,8 +675,8 @@ void arp_xmit(struct sk_buff *skb)
675675
/*
676676
* Create and send an arp packet.
677677
*/
678-
void arp_send(int type, int ptype, u32 dest_ip,
679-
struct net_device *dev, u32 src_ip,
678+
void arp_send(int type, int ptype, __be32 dest_ip,
679+
struct net_device *dev, __be32 src_ip,
680680
unsigned char *dest_hw, unsigned char *src_hw,
681681
unsigned char *target_hw)
682682
{
@@ -969,13 +969,13 @@ static int arp_rcv(struct sk_buff *skb, struct net_device *dev,
969969

970970
static int arp_req_set(struct arpreq *r, struct net_device * dev)
971971
{
972-
u32 ip = ((struct sockaddr_in *) &r->arp_pa)->sin_addr.s_addr;
972+
__be32 ip = ((struct sockaddr_in *) &r->arp_pa)->sin_addr.s_addr;
973973
struct neighbour *neigh;
974974
int err;
975975

976976
if (r->arp_flags&ATF_PUBL) {
977-
u32 mask = ((struct sockaddr_in *) &r->arp_netmask)->sin_addr.s_addr;
978-
if (mask && mask != 0xFFFFFFFF)
977+
__be32 mask = ((struct sockaddr_in *) &r->arp_netmask)->sin_addr.s_addr;
978+
if (mask && mask != htonl(0xFFFFFFFF))
979979
return -EINVAL;
980980
if (!dev && (r->arp_flags & ATF_COM)) {
981981
dev = dev_getbyhwaddr(r->arp_ha.sa_family, r->arp_ha.sa_data);
@@ -1063,7 +1063,7 @@ static unsigned arp_state_to_flags(struct neighbour *neigh)
10631063

10641064
static int arp_req_get(struct arpreq *r, struct net_device *dev)
10651065
{
1066-
u32 ip = ((struct sockaddr_in *) &r->arp_pa)->sin_addr.s_addr;
1066+
__be32 ip = ((struct sockaddr_in *) &r->arp_pa)->sin_addr.s_addr;
10671067
struct neighbour *neigh;
10681068
int err = -ENXIO;
10691069

@@ -1084,13 +1084,13 @@ static int arp_req_get(struct arpreq *r, struct net_device *dev)
10841084
static int arp_req_delete(struct arpreq *r, struct net_device * dev)
10851085
{
10861086
int err;
1087-
u32 ip = ((struct sockaddr_in *)&r->arp_pa)->sin_addr.s_addr;
1087+
__be32 ip = ((struct sockaddr_in *)&r->arp_pa)->sin_addr.s_addr;
10881088
struct neighbour *neigh;
10891089

10901090
if (r->arp_flags & ATF_PUBL) {
1091-
u32 mask =
1091+
__be32 mask =
10921092
((struct sockaddr_in *)&r->arp_netmask)->sin_addr.s_addr;
1093-
if (mask == 0xFFFFFFFF)
1093+
if (mask == htonl(0xFFFFFFFF))
10941094
return pneigh_delete(&arp_tbl, &ip, dev);
10951095
if (mask == 0) {
10961096
if (dev == NULL) {

0 commit comments

Comments
 (0)