aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/netfilter/nf_conntrack_tuple_common.h3
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h4
-rw-r--r--net/bridge/netfilter/ebt_ip6.c18
-rw-r--r--net/netfilter/ipvs/ip_vs_ftp.c10
4 files changed, 13 insertions, 22 deletions
diff --git a/include/linux/netfilter/nf_conntrack_tuple_common.h b/include/linux/netfilter/nf_conntrack_tuple_common.h
index 8e145f0d61cb..2ea22b018a87 100644
--- a/include/linux/netfilter/nf_conntrack_tuple_common.h
+++ b/include/linux/netfilter/nf_conntrack_tuple_common.h
@@ -1,8 +1,7 @@
1#ifndef _NF_CONNTRACK_TUPLE_COMMON_H 1#ifndef _NF_CONNTRACK_TUPLE_COMMON_H
2#define _NF_CONNTRACK_TUPLE_COMMON_H 2#define _NF_CONNTRACK_TUPLE_COMMON_H
3 3
4enum ip_conntrack_dir 4enum ip_conntrack_dir {
5{
6 IP_CT_DIR_ORIGINAL, 5 IP_CT_DIR_ORIGINAL,
7 IP_CT_DIR_REPLY, 6 IP_CT_DIR_REPLY,
8 IP_CT_DIR_MAX 7 IP_CT_DIR_MAX
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index e5ba03d783c6..18442ff19c07 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -316,10 +316,6 @@ extern int ip6t_ext_hdr(u8 nexthdr);
316extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, 316extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
317 int target, unsigned short *fragoff); 317 int target, unsigned short *fragoff);
318 318
319extern int ip6_masked_addrcmp(const struct in6_addr *addr1,
320 const struct in6_addr *mask,
321 const struct in6_addr *addr2);
322
323#define IP6T_ALIGN(s) XT_ALIGN(s) 319#define IP6T_ALIGN(s) XT_ALIGN(s)
324 320
325#ifdef CONFIG_COMPAT 321#ifdef CONFIG_COMPAT
diff --git a/net/bridge/netfilter/ebt_ip6.c b/net/bridge/netfilter/ebt_ip6.c
index 05d0d0c4ccb9..63e3888d20cf 100644
--- a/net/bridge/netfilter/ebt_ip6.c
+++ b/net/bridge/netfilter/ebt_ip6.c
@@ -35,8 +35,6 @@ ebt_ip6_mt(const struct sk_buff *skb, const struct xt_match_param *par)
35 struct ipv6hdr _ip6h; 35 struct ipv6hdr _ip6h;
36 const struct tcpudphdr *pptr; 36 const struct tcpudphdr *pptr;
37 struct tcpudphdr _ports; 37 struct tcpudphdr _ports;
38 struct in6_addr tmp_addr;
39 int i;
40 38
41 ih6 = skb_header_pointer(skb, 0, sizeof(_ip6h), &_ip6h); 39 ih6 = skb_header_pointer(skb, 0, sizeof(_ip6h), &_ip6h);
42 if (ih6 == NULL) 40 if (ih6 == NULL)
@@ -44,18 +42,10 @@ ebt_ip6_mt(const struct sk_buff *skb, const struct xt_match_param *par)
44 if (info->bitmask & EBT_IP6_TCLASS && 42 if (info->bitmask & EBT_IP6_TCLASS &&
45 FWINV(info->tclass != ipv6_get_dsfield(ih6), EBT_IP6_TCLASS)) 43 FWINV(info->tclass != ipv6_get_dsfield(ih6), EBT_IP6_TCLASS))
46 return false; 44 return false;
47 for (i = 0; i < 4; i++) 45 if (FWINV(ipv6_masked_addr_cmp(&ih6->saddr, &info->smsk,
48 tmp_addr.in6_u.u6_addr32[i] = ih6->saddr.in6_u.u6_addr32[i] & 46 &info->saddr), EBT_IP6_SOURCE) ||
49 info->smsk.in6_u.u6_addr32[i]; 47 FWINV(ipv6_masked_addr_cmp(&ih6->daddr, &info->dmsk,
50 if (info->bitmask & EBT_IP6_SOURCE && 48 &info->daddr), EBT_IP6_DEST))
51 FWINV((ipv6_addr_cmp(&tmp_addr, &info->saddr) != 0),
52 EBT_IP6_SOURCE))
53 return false;
54 for (i = 0; i < 4; i++)
55 tmp_addr.in6_u.u6_addr32[i] = ih6->daddr.in6_u.u6_addr32[i] &
56 info->dmsk.in6_u.u6_addr32[i];
57 if (info->bitmask & EBT_IP6_DEST &&
58 FWINV((ipv6_addr_cmp(&tmp_addr, &info->daddr) != 0), EBT_IP6_DEST))
59 return false; 49 return false;
60 if (info->bitmask & EBT_IP6_PROTO) { 50 if (info->bitmask & EBT_IP6_PROTO) {
61 uint8_t nexthdr = ih6->nexthdr; 51 uint8_t nexthdr = ih6->nexthdr;
diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c
index 73f38ea98f25..9f6328303844 100644
--- a/net/netfilter/ipvs/ip_vs_ftp.c
+++ b/net/netfilter/ipvs/ip_vs_ftp.c
@@ -208,8 +208,14 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
208 */ 208 */
209 from.ip = n_cp->vaddr.ip; 209 from.ip = n_cp->vaddr.ip;
210 port = n_cp->vport; 210 port = n_cp->vport;
211 sprintf(buf, "%u,%u,%u,%u,%u,%u", NIPQUAD(from.ip), 211 snprintf(buf, sizeof(buf), "%u,%u,%u,%u,%u,%u",
212 (ntohs(port)>>8)&255, ntohs(port)&255); 212 ((unsigned char *)&from.ip)[0],
213 ((unsigned char *)&from.ip)[1],
214 ((unsigned char *)&from.ip)[2],
215 ((unsigned char *)&from.ip)[3],
216 ntohs(port) >> 8,
217 ntohs(port) & 0xFF);
218
213 buf_len = strlen(buf); 219 buf_len = strlen(buf);
214 220
215 /* 221 /*