]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
pknock: mark peer address as __be32
authorJan Engelhardt <jengelh@medozas.de>
Sat, 3 Oct 2009 21:21:54 +0000 (23:21 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Sat, 3 Oct 2009 22:42:13 +0000 (00:42 +0200)
Since the address is now stored in its original network byte order,
let's annotate that this is indeed the case.

extensions/xt_pknock.c
extensions/xt_pknock.h

index 5efa94278629b4d18f756cc1bbf8e758efabae48..37794fc8b911be1254d26223c04fa308ef25ae0b 100644 (file)
@@ -51,7 +51,7 @@ enum status {
  */
 struct peer {
        struct list_head head;
-       uint32_t ip;
+       __be32 ip;
        uint8_t proto;
        uint32_t id_port_knocked;
        enum status status;
@@ -542,7 +542,7 @@ remove_rule(struct xt_pknock_mtinfo *info)
  * @ip
  * @return: peer or NULL
  */
-static struct peer *get_peer(struct xt_pknock_rule *rule, uint32_t ip)
+static struct peer *get_peer(struct xt_pknock_rule *rule, __be32 ip)
 {
        struct peer *peer;
        struct list_head *pos, *n;
@@ -576,7 +576,7 @@ static void reset_knock_status(struct peer *peer)
  * @proto
  * @return: peer or NULL
  */
-static struct peer *new_peer(uint32_t ip, uint8_t proto)
+static struct peer *new_peer(__be32 ip, uint8_t proto)
 {
        struct peer *peer = kmalloc(sizeof(*peer), GFP_ATOMIC);
 
index bb82c076639b10c998b11d27411c21cc538cda1a..38fb62dc9771bee831c50628bb9c29a9bf3ead5b 100644 (file)
@@ -45,7 +45,7 @@ struct xt_pknock_mtinfo {
 
 struct xt_pknock_nl_msg {
        char rule_name[XT_PKNOCK_MAX_BUF_LEN+1];
-       uint32_t        peer_ip;
+       __be32 peer_ip;
 };
 
 #endif /* _XT_PKNOCK_H */