diff options
-rw-r--r-- | net/netfilter/nf_conntrack_irc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/net/netfilter/nf_conntrack_irc.c b/net/netfilter/nf_conntrack_irc.c index 409c8be58e7c..8bd98c84f77e 100644 --- a/net/netfilter/nf_conntrack_irc.c +++ b/net/netfilter/nf_conntrack_irc.c | |||
@@ -66,7 +66,7 @@ static const char *const dccprotos[] = { | |||
66 | * ad_beg_p returns pointer to first byte of addr data | 66 | * ad_beg_p returns pointer to first byte of addr data |
67 | * ad_end_p returns pointer to last byte of addr data | 67 | * ad_end_p returns pointer to last byte of addr data |
68 | */ | 68 | */ |
69 | static int parse_dcc(char *data, const char *data_end, u_int32_t *ip, | 69 | static int parse_dcc(char *data, const char *data_end, __be32 *ip, |
70 | u_int16_t *port, char **ad_beg_p, char **ad_end_p) | 70 | u_int16_t *port, char **ad_beg_p, char **ad_end_p) |
71 | { | 71 | { |
72 | char *tmp; | 72 | char *tmp; |
@@ -85,7 +85,7 @@ static int parse_dcc(char *data, const char *data_end, u_int32_t *ip, | |||
85 | return -1; | 85 | return -1; |
86 | 86 | ||
87 | *ad_beg_p = data; | 87 | *ad_beg_p = data; |
88 | *ip = simple_strtoul(data, &data, 10); | 88 | *ip = cpu_to_be32(simple_strtoul(data, &data, 10)); |
89 | 89 | ||
90 | /* skip blanks between ip and port */ | 90 | /* skip blanks between ip and port */ |
91 | while (*data == ' ') { | 91 | while (*data == ' ') { |
@@ -112,7 +112,7 @@ static int help(struct sk_buff *skb, unsigned int protoff, | |||
112 | int dir = CTINFO2DIR(ctinfo); | 112 | int dir = CTINFO2DIR(ctinfo); |
113 | struct nf_conntrack_expect *exp; | 113 | struct nf_conntrack_expect *exp; |
114 | struct nf_conntrack_tuple *tuple; | 114 | struct nf_conntrack_tuple *tuple; |
115 | u_int32_t dcc_ip; | 115 | __be32 dcc_ip; |
116 | u_int16_t dcc_port; | 116 | u_int16_t dcc_port; |
117 | __be16 port; | 117 | __be16 port; |
118 | int i, ret = NF_ACCEPT; | 118 | int i, ret = NF_ACCEPT; |
@@ -177,13 +177,14 @@ static int help(struct sk_buff *skb, unsigned int protoff, | |||
177 | pr_debug("unable to parse dcc command\n"); | 177 | pr_debug("unable to parse dcc command\n"); |
178 | continue; | 178 | continue; |
179 | } | 179 | } |
180 | pr_debug("DCC bound ip/port: %u.%u.%u.%u:%u\n", | 180 | |
181 | HIPQUAD(dcc_ip), dcc_port); | 181 | pr_debug("DCC bound ip/port: %pI4:%u\n", |
182 | &dcc_ip, dcc_port); | ||
182 | 183 | ||
183 | /* dcc_ip can be the internal OR external (NAT'ed) IP */ | 184 | /* dcc_ip can be the internal OR external (NAT'ed) IP */ |
184 | tuple = &ct->tuplehash[dir].tuple; | 185 | tuple = &ct->tuplehash[dir].tuple; |
185 | if (tuple->src.u3.ip != htonl(dcc_ip) && | 186 | if (tuple->src.u3.ip != dcc_ip && |
186 | tuple->dst.u3.ip != htonl(dcc_ip)) { | 187 | tuple->dst.u3.ip != dcc_ip) { |
187 | if (net_ratelimit()) | 188 | if (net_ratelimit()) |
188 | printk(KERN_WARNING | 189 | printk(KERN_WARNING |
189 | "Forged DCC command from %pI4: %pI4:%u\n", | 190 | "Forged DCC command from %pI4: %pI4:%u\n", |