Skip to content

Commit f6e276e

Browse files
Alexey Dobriyandavem330
authored andcommitted
[ATALK]: endian annotations
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent f852640 commit f6e276e

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

‎include/linux/atalk.h‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#define SIOCATALKDIFADDR (SIOCPROTOPRIVATE + 0)
2121

2222
struct atalk_addr {
23-
__u16 s_net;
23+
__be16 s_net;
2424
__u8 s_node;
2525
};
2626

@@ -33,8 +33,8 @@ struct sockaddr_at {
3333

3434
struct atalk_netrange {
3535
__u8 nr_phase;
36-
__u16 nr_firstnet;
37-
__u16 nr_lastnet;
36+
__be16 nr_firstnet;
37+
__be16 nr_lastnet;
3838
};
3939

4040
#ifdef __KERNEL__
@@ -70,8 +70,8 @@ struct atalk_iface {
7070
struct atalk_sock {
7171
/* struct sock has to be the first member of atalk_sock */
7272
struct sock sk;
73-
unsigned short dest_net;
74-
unsigned short src_net;
73+
__be16 dest_net;
74+
__be16 src_net;
7575
unsigned char dest_node;
7676
unsigned char src_node;
7777
unsigned char dest_port;
@@ -95,9 +95,9 @@ struct ddpehdr {
9595
deh_hops:4,
9696
deh_len:10;
9797
#endif
98-
__u16 deh_sum;
99-
__u16 deh_dnet;
100-
__u16 deh_snet;
98+
__be16 deh_sum;
99+
__be16 deh_dnet;
100+
__be16 deh_snet;
101101
__u8 deh_dnode;
102102
__u8 deh_snode;
103103
__u8 deh_dport;
@@ -142,24 +142,24 @@ struct ddpshdr {
142142

143143
/* AppleTalk AARP headers */
144144
struct elapaarp {
145-
__u16 hw_type;
145+
__be16 hw_type;
146146
#define AARP_HW_TYPE_ETHERNET 1
147147
#define AARP_HW_TYPE_TOKENRING 2
148-
__u16 pa_type;
148+
__be16 pa_type;
149149
__u8 hw_len;
150150
__u8 pa_len;
151151
#define AARP_PA_ALEN 4
152-
__u16 function;
152+
__be16 function;
153153
#define AARP_REQUEST 1
154154
#define AARP_REPLY 2
155155
#define AARP_PROBE 3
156156
__u8 hw_src[ETH_ALEN] __attribute__ ((packed));
157157
__u8 pa_src_zero __attribute__ ((packed));
158-
__u16 pa_src_net __attribute__ ((packed));
158+
__be16 pa_src_net __attribute__ ((packed));
159159
__u8 pa_src_node __attribute__ ((packed));
160160
__u8 hw_dst[ETH_ALEN] __attribute__ ((packed));
161161
__u8 pa_dst_zero __attribute__ ((packed));
162-
__u16 pa_dst_net __attribute__ ((packed));
162+
__be16 pa_dst_net __attribute__ ((packed));
163163
__u8 pa_dst_node __attribute__ ((packed));
164164
};
165165

‎net/appletalk/aarp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ int aarp_send_ddp(struct net_device *dev, struct sk_buff *skb,
565565
* numbers we just happen to need. Now put the
566566
* length in the lower two.
567567
*/
568-
*((__u16 *)skb->data) = htons(skb->len);
568+
*((__be16 *)skb->data) = htons(skb->len);
569569
ft = 1;
570570
}
571571
/*

‎net/appletalk/ddp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ static struct atalk_iface *atalk_find_anynet(int node, struct net_device *dev)
401401
}
402402

403403
/* Find a match for a specific network:node pair */
404-
static struct atalk_iface *atalk_find_interface(int net, int node)
404+
static struct atalk_iface *atalk_find_interface(__be16 net, int node)
405405
{
406406
struct atalk_iface *iface;
407407

0 commit comments

Comments
 (0)