aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-10-28 15:59:53 -0400
committerDavid S. Miller <davem@davemloft.net>2010-10-28 15:59:53 -0400
commit089282fb028198169a0f62f8f833ab6d06bdbb3c (patch)
treead5377fa1310bdf3e8c24694ac729eba4cdada0c /net
parent19449bfc10d163f0024dd5ae5808e28cda32e7b4 (diff)
netfilter: xt_socket: Make tproto signed in socket_mt6_v1().
Otherwise error indications from ipv6_find_hdr() won't be noticed. This required making the protocol argument to extract_icmp6_fields() signed too. Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/xt_socket.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/netfilter/xt_socket.c b/net/netfilter/xt_socket.c
index d94a858dc52a..00d6ae838303 100644
--- a/net/netfilter/xt_socket.c
+++ b/net/netfilter/xt_socket.c
@@ -195,7 +195,7 @@ socket_mt4_v1(const struct sk_buff *skb, struct xt_action_param *par)
195static int 195static int
196extract_icmp6_fields(const struct sk_buff *skb, 196extract_icmp6_fields(const struct sk_buff *skb,
197 unsigned int outside_hdrlen, 197 unsigned int outside_hdrlen,
198 u8 *protocol, 198 int *protocol,
199 struct in6_addr **raddr, 199 struct in6_addr **raddr,
200 struct in6_addr **laddr, 200 struct in6_addr **laddr,
201 __be16 *rport, 201 __be16 *rport,
@@ -252,8 +252,7 @@ socket_mt6_v1(const struct sk_buff *skb, struct xt_action_param *par)
252 struct sock *sk; 252 struct sock *sk;
253 struct in6_addr *daddr, *saddr; 253 struct in6_addr *daddr, *saddr;
254 __be16 dport, sport; 254 __be16 dport, sport;
255 int thoff; 255 int thoff, tproto;
256 u8 tproto;
257 const struct xt_socket_mtinfo1 *info = (struct xt_socket_mtinfo1 *) par->matchinfo; 256 const struct xt_socket_mtinfo1 *info = (struct xt_socket_mtinfo1 *) par->matchinfo;
258 257
259 tproto = ipv6_find_hdr(skb, &thoff, -1, NULL); 258 tproto = ipv6_find_hdr(skb, &thoff, -1, NULL);
@@ -305,7 +304,7 @@ socket_mt6_v1(const struct sk_buff *skb, struct xt_action_param *par)
305 sk = NULL; 304 sk = NULL;
306 } 305 }
307 306
308 pr_debug("proto %hhu %pI6:%hu -> %pI6:%hu " 307 pr_debug("proto %hhd %pI6:%hu -> %pI6:%hu "
309 "(orig %pI6:%hu) sock %p\n", 308 "(orig %pI6:%hu) sock %p\n",
310 tproto, saddr, ntohs(sport), 309 tproto, saddr, ntohs(sport),
311 daddr, ntohs(dport), 310 daddr, ntohs(dport),