Commit 089282fb authored by David S. Miller's avatar David S. Miller

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: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 19449bfc
...@@ -195,7 +195,7 @@ socket_mt4_v1(const struct sk_buff *skb, struct xt_action_param *par) ...@@ -195,7 +195,7 @@ socket_mt4_v1(const struct sk_buff *skb, struct xt_action_param *par)
static int static int
extract_icmp6_fields(const struct sk_buff *skb, extract_icmp6_fields(const struct sk_buff *skb,
unsigned int outside_hdrlen, unsigned int outside_hdrlen,
u8 *protocol, int *protocol,
struct in6_addr **raddr, struct in6_addr **raddr,
struct in6_addr **laddr, struct in6_addr **laddr,
__be16 *rport, __be16 *rport,
...@@ -252,8 +252,7 @@ socket_mt6_v1(const struct sk_buff *skb, struct xt_action_param *par) ...@@ -252,8 +252,7 @@ socket_mt6_v1(const struct sk_buff *skb, struct xt_action_param *par)
struct sock *sk; struct sock *sk;
struct in6_addr *daddr, *saddr; struct in6_addr *daddr, *saddr;
__be16 dport, sport; __be16 dport, sport;
int thoff; int thoff, tproto;
u8 tproto;
const struct xt_socket_mtinfo1 *info = (struct xt_socket_mtinfo1 *) par->matchinfo; const struct xt_socket_mtinfo1 *info = (struct xt_socket_mtinfo1 *) par->matchinfo;
tproto = ipv6_find_hdr(skb, &thoff, -1, NULL); 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,7 +304,7 @@ socket_mt6_v1(const struct sk_buff *skb, struct xt_action_param *par)
sk = NULL; sk = NULL;
} }
pr_debug("proto %hhu %pI6:%hu -> %pI6:%hu " pr_debug("proto %hhd %pI6:%hu -> %pI6:%hu "
"(orig %pI6:%hu) sock %p\n", "(orig %pI6:%hu) sock %p\n",
tproto, saddr, ntohs(sport), tproto, saddr, ntohs(sport),
daddr, ntohs(dport), daddr, ntohs(dport),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment