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 /net | |
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>
Diffstat (limited to 'net')
-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 |
3 files changed, 16 insertions, 19 deletions
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) |