diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-11-08 03:26:51 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:21:25 -0500 |
commit | 98a4a86128d7179b22365e16bf880e849e20bc7d (patch) | |
tree | b6270c203f6075118fd36b86a77bdf7a39da6566 | |
parent | 0e11c91e1e912bc4db5b71607d149e7e9a77e756 (diff) |
[NETFILTER]: trivial annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/netfilter/nfnetlink.h | 2 | ||||
-rw-r--r-- | include/linux/netfilter/nfnetlink_log.h | 10 | ||||
-rw-r--r-- | include/linux/netfilter/nfnetlink_queue.h | 18 | ||||
-rw-r--r-- | include/linux/netfilter/xt_conntrack.h | 4 | ||||
-rw-r--r-- | include/linux/netfilter/xt_policy.h | 2 | ||||
-rw-r--r-- | include/linux/types.h | 2 | ||||
-rw-r--r-- | net/netfilter/nfnetlink_log.c | 22 | ||||
-rw-r--r-- | net/netfilter/nfnetlink_queue.c | 9 | ||||
-rw-r--r-- | net/netfilter/xt_multiport.c | 4 |
9 files changed, 36 insertions, 37 deletions
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 6d8e3e5a80e9..1e9c821f152d 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
@@ -78,7 +78,7 @@ struct nfattr | |||
78 | struct nfgenmsg { | 78 | struct nfgenmsg { |
79 | u_int8_t nfgen_family; /* AF_xxx */ | 79 | u_int8_t nfgen_family; /* AF_xxx */ |
80 | u_int8_t version; /* nfnetlink version */ | 80 | u_int8_t version; /* nfnetlink version */ |
81 | u_int16_t res_id; /* resource id */ | 81 | __be16 res_id; /* resource id */ |
82 | }; | 82 | }; |
83 | 83 | ||
84 | #define NFNETLINK_V0 0 | 84 | #define NFNETLINK_V0 0 |
diff --git a/include/linux/netfilter/nfnetlink_log.h b/include/linux/netfilter/nfnetlink_log.h index 87b92f8b988f..55a2a2b814ed 100644 --- a/include/linux/netfilter/nfnetlink_log.h +++ b/include/linux/netfilter/nfnetlink_log.h | |||
@@ -16,20 +16,20 @@ enum nfulnl_msg_types { | |||
16 | }; | 16 | }; |
17 | 17 | ||
18 | struct nfulnl_msg_packet_hdr { | 18 | struct nfulnl_msg_packet_hdr { |
19 | u_int16_t hw_protocol; /* hw protocol (network order) */ | 19 | __be16 hw_protocol; /* hw protocol (network order) */ |
20 | u_int8_t hook; /* netfilter hook */ | 20 | u_int8_t hook; /* netfilter hook */ |
21 | u_int8_t _pad; | 21 | u_int8_t _pad; |
22 | }; | 22 | }; |
23 | 23 | ||
24 | struct nfulnl_msg_packet_hw { | 24 | struct nfulnl_msg_packet_hw { |
25 | u_int16_t hw_addrlen; | 25 | __be16 hw_addrlen; |
26 | u_int16_t _pad; | 26 | u_int16_t _pad; |
27 | u_int8_t hw_addr[8]; | 27 | u_int8_t hw_addr[8]; |
28 | }; | 28 | }; |
29 | 29 | ||
30 | struct nfulnl_msg_packet_timestamp { | 30 | struct nfulnl_msg_packet_timestamp { |
31 | aligned_u64 sec; | 31 | aligned_be64 sec; |
32 | aligned_u64 usec; | 32 | aligned_be64 usec; |
33 | }; | 33 | }; |
34 | 34 | ||
35 | #define NFULNL_PREFIXLEN 30 /* just like old log target */ | 35 | #define NFULNL_PREFIXLEN 30 /* just like old log target */ |
@@ -67,7 +67,7 @@ struct nfulnl_msg_config_cmd { | |||
67 | } __attribute__ ((packed)); | 67 | } __attribute__ ((packed)); |
68 | 68 | ||
69 | struct nfulnl_msg_config_mode { | 69 | struct nfulnl_msg_config_mode { |
70 | u_int32_t copy_range; | 70 | __be32 copy_range; |
71 | u_int8_t copy_mode; | 71 | u_int8_t copy_mode; |
72 | u_int8_t _pad; | 72 | u_int8_t _pad; |
73 | } __attribute__ ((packed)); | 73 | } __attribute__ ((packed)); |
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h index 36af0360b56d..4beea3d6fda8 100644 --- a/include/linux/netfilter/nfnetlink_queue.h +++ b/include/linux/netfilter/nfnetlink_queue.h | |||
@@ -13,20 +13,20 @@ enum nfqnl_msg_types { | |||
13 | }; | 13 | }; |
14 | 14 | ||
15 | struct nfqnl_msg_packet_hdr { | 15 | struct nfqnl_msg_packet_hdr { |
16 | u_int32_t packet_id; /* unique ID of packet in queue */ | 16 | __be32 packet_id; /* unique ID of packet in queue */ |
17 | u_int16_t hw_protocol; /* hw protocol (network order) */ | 17 | __be16 hw_protocol; /* hw protocol (network order) */ |
18 | u_int8_t hook; /* netfilter hook */ | 18 | u_int8_t hook; /* netfilter hook */ |
19 | } __attribute__ ((packed)); | 19 | } __attribute__ ((packed)); |
20 | 20 | ||
21 | struct nfqnl_msg_packet_hw { | 21 | struct nfqnl_msg_packet_hw { |
22 | u_int16_t hw_addrlen; | 22 | __be16 hw_addrlen; |
23 | u_int16_t _pad; | 23 | u_int16_t _pad; |
24 | u_int8_t hw_addr[8]; | 24 | u_int8_t hw_addr[8]; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | struct nfqnl_msg_packet_timestamp { | 27 | struct nfqnl_msg_packet_timestamp { |
28 | aligned_u64 sec; | 28 | aligned_be64 sec; |
29 | aligned_u64 usec; | 29 | aligned_be64 usec; |
30 | }; | 30 | }; |
31 | 31 | ||
32 | enum nfqnl_attr_type { | 32 | enum nfqnl_attr_type { |
@@ -47,8 +47,8 @@ enum nfqnl_attr_type { | |||
47 | #define NFQA_MAX (__NFQA_MAX - 1) | 47 | #define NFQA_MAX (__NFQA_MAX - 1) |
48 | 48 | ||
49 | struct nfqnl_msg_verdict_hdr { | 49 | struct nfqnl_msg_verdict_hdr { |
50 | u_int32_t verdict; | 50 | __be32 verdict; |
51 | u_int32_t id; | 51 | __be32 id; |
52 | }; | 52 | }; |
53 | 53 | ||
54 | 54 | ||
@@ -63,7 +63,7 @@ enum nfqnl_msg_config_cmds { | |||
63 | struct nfqnl_msg_config_cmd { | 63 | struct nfqnl_msg_config_cmd { |
64 | u_int8_t command; /* nfqnl_msg_config_cmds */ | 64 | u_int8_t command; /* nfqnl_msg_config_cmds */ |
65 | u_int8_t _pad; | 65 | u_int8_t _pad; |
66 | u_int16_t pf; /* AF_xxx for PF_[UN]BIND */ | 66 | __be16 pf; /* AF_xxx for PF_[UN]BIND */ |
67 | }; | 67 | }; |
68 | 68 | ||
69 | enum nfqnl_config_mode { | 69 | enum nfqnl_config_mode { |
@@ -73,7 +73,7 @@ enum nfqnl_config_mode { | |||
73 | }; | 73 | }; |
74 | 74 | ||
75 | struct nfqnl_msg_config_params { | 75 | struct nfqnl_msg_config_params { |
76 | u_int32_t copy_range; | 76 | __be32 copy_range; |
77 | u_int8_t copy_mode; /* enum nfqnl_config_mode */ | 77 | u_int8_t copy_mode; /* enum nfqnl_config_mode */ |
78 | } __attribute__ ((packed)); | 78 | } __attribute__ ((packed)); |
79 | 79 | ||
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h index 4c2d9945ca54..70b6f718cf4c 100644 --- a/include/linux/netfilter/xt_conntrack.h +++ b/include/linux/netfilter/xt_conntrack.h | |||
@@ -29,14 +29,14 @@ | |||
29 | struct ip_conntrack_old_tuple | 29 | struct ip_conntrack_old_tuple |
30 | { | 30 | { |
31 | struct { | 31 | struct { |
32 | __u32 ip; | 32 | __be32 ip; |
33 | union { | 33 | union { |
34 | __u16 all; | 34 | __u16 all; |
35 | } u; | 35 | } u; |
36 | } src; | 36 | } src; |
37 | 37 | ||
38 | struct { | 38 | struct { |
39 | __u32 ip; | 39 | __be32 ip; |
40 | union { | 40 | union { |
41 | __u16 all; | 41 | __u16 all; |
42 | } u; | 42 | } u; |
diff --git a/include/linux/netfilter/xt_policy.h b/include/linux/netfilter/xt_policy.h index a8132ec076fb..45654d359a68 100644 --- a/include/linux/netfilter/xt_policy.h +++ b/include/linux/netfilter/xt_policy.h | |||
@@ -39,7 +39,7 @@ struct xt_policy_elem | |||
39 | union xt_policy_addr smask; | 39 | union xt_policy_addr smask; |
40 | union xt_policy_addr daddr; | 40 | union xt_policy_addr daddr; |
41 | union xt_policy_addr dmask; | 41 | union xt_policy_addr dmask; |
42 | u_int32_t spi; | 42 | __be32 spi; |
43 | u_int32_t reqid; | 43 | u_int32_t reqid; |
44 | u_int8_t proto; | 44 | u_int8_t proto; |
45 | u_int8_t mode; | 45 | u_int8_t mode; |
diff --git a/include/linux/types.h b/include/linux/types.h index 750f085fa564..9f11fdd2bd72 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -128,6 +128,8 @@ typedef __s64 int64_t; | |||
128 | 128 | ||
129 | /* this is a special 64bit data type that is 8-byte aligned */ | 129 | /* this is a special 64bit data type that is 8-byte aligned */ |
130 | #define aligned_u64 unsigned long long __attribute__((aligned(8))) | 130 | #define aligned_u64 unsigned long long __attribute__((aligned(8))) |
131 | #define aligned_be64 __be64 __attribute__((aligned(8))) | ||
132 | #define aligned_le64 __le64 __attribute__((aligned(8))) | ||
131 | 133 | ||
132 | /** | 134 | /** |
133 | * The type used for indexing onto a disc or disc partition. | 135 | * The type used for indexing onto a disc or disc partition. |
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index 1e5207b80fe5..856ed0d19974 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c | |||
@@ -414,7 +414,7 @@ __build_packet_message(struct nfulnl_instance *inst, | |||
414 | struct nfulnl_msg_packet_hdr pmsg; | 414 | struct nfulnl_msg_packet_hdr pmsg; |
415 | struct nlmsghdr *nlh; | 415 | struct nlmsghdr *nlh; |
416 | struct nfgenmsg *nfmsg; | 416 | struct nfgenmsg *nfmsg; |
417 | u_int32_t tmp_uint; | 417 | __be32 tmp_uint; |
418 | 418 | ||
419 | UDEBUG("entered\n"); | 419 | UDEBUG("entered\n"); |
420 | 420 | ||
@@ -508,11 +508,9 @@ __build_packet_message(struct nfulnl_instance *inst, | |||
508 | 508 | ||
509 | if (indev && skb->dev && skb->dev->hard_header_parse) { | 509 | if (indev && skb->dev && skb->dev->hard_header_parse) { |
510 | struct nfulnl_msg_packet_hw phw; | 510 | struct nfulnl_msg_packet_hw phw; |
511 | 511 | int len = skb->dev->hard_header_parse((struct sk_buff *)skb, | |
512 | phw.hw_addrlen = | ||
513 | skb->dev->hard_header_parse((struct sk_buff *)skb, | ||
514 | phw.hw_addr); | 512 | phw.hw_addr); |
515 | phw.hw_addrlen = htons(phw.hw_addrlen); | 513 | phw.hw_addrlen = htons(len); |
516 | NFA_PUT(inst->skb, NFULA_HWADDR, sizeof(phw), &phw); | 514 | NFA_PUT(inst->skb, NFULA_HWADDR, sizeof(phw), &phw); |
517 | } | 515 | } |
518 | 516 | ||
@@ -529,7 +527,7 @@ __build_packet_message(struct nfulnl_instance *inst, | |||
529 | if (skb->sk) { | 527 | if (skb->sk) { |
530 | read_lock_bh(&skb->sk->sk_callback_lock); | 528 | read_lock_bh(&skb->sk->sk_callback_lock); |
531 | if (skb->sk->sk_socket && skb->sk->sk_socket->file) { | 529 | if (skb->sk->sk_socket && skb->sk->sk_socket->file) { |
532 | u_int32_t uid = htonl(skb->sk->sk_socket->file->f_uid); | 530 | __be32 uid = htonl(skb->sk->sk_socket->file->f_uid); |
533 | /* need to unlock here since NFA_PUT may goto */ | 531 | /* need to unlock here since NFA_PUT may goto */ |
534 | read_unlock_bh(&skb->sk->sk_callback_lock); | 532 | read_unlock_bh(&skb->sk->sk_callback_lock); |
535 | NFA_PUT(inst->skb, NFULA_UID, sizeof(uid), &uid); | 533 | NFA_PUT(inst->skb, NFULA_UID, sizeof(uid), &uid); |
@@ -882,15 +880,15 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb, | |||
882 | } | 880 | } |
883 | 881 | ||
884 | if (nfula[NFULA_CFG_TIMEOUT-1]) { | 882 | if (nfula[NFULA_CFG_TIMEOUT-1]) { |
885 | u_int32_t timeout = | 883 | __be32 timeout = |
886 | *(u_int32_t *)NFA_DATA(nfula[NFULA_CFG_TIMEOUT-1]); | 884 | *(__be32 *)NFA_DATA(nfula[NFULA_CFG_TIMEOUT-1]); |
887 | 885 | ||
888 | nfulnl_set_timeout(inst, ntohl(timeout)); | 886 | nfulnl_set_timeout(inst, ntohl(timeout)); |
889 | } | 887 | } |
890 | 888 | ||
891 | if (nfula[NFULA_CFG_NLBUFSIZ-1]) { | 889 | if (nfula[NFULA_CFG_NLBUFSIZ-1]) { |
892 | u_int32_t nlbufsiz = | 890 | __be32 nlbufsiz = |
893 | *(u_int32_t *)NFA_DATA(nfula[NFULA_CFG_NLBUFSIZ-1]); | 891 | *(__be32 *)NFA_DATA(nfula[NFULA_CFG_NLBUFSIZ-1]); |
894 | 892 | ||
895 | nfulnl_set_nlbufsiz(inst, ntohl(nlbufsiz)); | 893 | nfulnl_set_nlbufsiz(inst, ntohl(nlbufsiz)); |
896 | } | 894 | } |
@@ -903,8 +901,8 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb, | |||
903 | } | 901 | } |
904 | 902 | ||
905 | if (nfula[NFULA_CFG_FLAGS-1]) { | 903 | if (nfula[NFULA_CFG_FLAGS-1]) { |
906 | u_int16_t flags = | 904 | __be16 flags = |
907 | *(u_int16_t *)NFA_DATA(nfula[NFULA_CFG_FLAGS-1]); | 905 | *(__be16 *)NFA_DATA(nfula[NFULA_CFG_FLAGS-1]); |
908 | nfulnl_set_flags(inst, ntohs(flags)); | 906 | nfulnl_set_flags(inst, ntohs(flags)); |
909 | } | 907 | } |
910 | 908 | ||
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index e815a9aa6e95..4ab7b1416bb5 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c | |||
@@ -349,7 +349,7 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue, | |||
349 | struct sk_buff *entskb = entry->skb; | 349 | struct sk_buff *entskb = entry->skb; |
350 | struct net_device *indev; | 350 | struct net_device *indev; |
351 | struct net_device *outdev; | 351 | struct net_device *outdev; |
352 | unsigned int tmp_uint; | 352 | __be32 tmp_uint; |
353 | 353 | ||
354 | QDEBUG("entered\n"); | 354 | QDEBUG("entered\n"); |
355 | 355 | ||
@@ -489,10 +489,9 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue, | |||
489 | && entskb->dev->hard_header_parse) { | 489 | && entskb->dev->hard_header_parse) { |
490 | struct nfqnl_msg_packet_hw phw; | 490 | struct nfqnl_msg_packet_hw phw; |
491 | 491 | ||
492 | phw.hw_addrlen = | 492 | int len = entskb->dev->hard_header_parse(entskb, |
493 | entskb->dev->hard_header_parse(entskb, | ||
494 | phw.hw_addr); | 493 | phw.hw_addr); |
495 | phw.hw_addrlen = htons(phw.hw_addrlen); | 494 | phw.hw_addrlen = htons(len); |
496 | NFA_PUT(skb, NFQA_HWADDR, sizeof(phw), &phw); | 495 | NFA_PUT(skb, NFQA_HWADDR, sizeof(phw), &phw); |
497 | } | 496 | } |
498 | 497 | ||
@@ -835,7 +834,7 @@ nfqnl_recv_verdict(struct sock *ctnl, struct sk_buff *skb, | |||
835 | } | 834 | } |
836 | 835 | ||
837 | if (nfqa[NFQA_MARK-1]) | 836 | if (nfqa[NFQA_MARK-1]) |
838 | entry->skb->nfmark = ntohl(*(u_int32_t *) | 837 | entry->skb->nfmark = ntohl(*(__be32 *) |
839 | NFA_DATA(nfqa[NFQA_MARK-1])); | 838 | NFA_DATA(nfqa[NFQA_MARK-1])); |
840 | 839 | ||
841 | issue_verdict(entry, verdict); | 840 | issue_verdict(entry, verdict); |
diff --git a/net/netfilter/xt_multiport.c b/net/netfilter/xt_multiport.c index d3aefd380930..b4293058c6ff 100644 --- a/net/netfilter/xt_multiport.c +++ b/net/netfilter/xt_multiport.c | |||
@@ -104,7 +104,7 @@ match(const struct sk_buff *skb, | |||
104 | unsigned int protoff, | 104 | unsigned int protoff, |
105 | int *hotdrop) | 105 | int *hotdrop) |
106 | { | 106 | { |
107 | u16 _ports[2], *pptr; | 107 | __be16 _ports[2], *pptr; |
108 | const struct xt_multiport *multiinfo = matchinfo; | 108 | const struct xt_multiport *multiinfo = matchinfo; |
109 | 109 | ||
110 | if (offset) | 110 | if (offset) |
@@ -135,7 +135,7 @@ match_v1(const struct sk_buff *skb, | |||
135 | unsigned int protoff, | 135 | unsigned int protoff, |
136 | int *hotdrop) | 136 | int *hotdrop) |
137 | { | 137 | { |
138 | u16 _ports[2], *pptr; | 138 | __be16 _ports[2], *pptr; |
139 | const struct xt_multiport_v1 *multiinfo = matchinfo; | 139 | const struct xt_multiport_v1 *multiinfo = matchinfo; |
140 | 140 | ||
141 | if (offset) | 141 | if (offset) |