Commit 1fe7d5a3 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[NETFILTER]: Fix two broken checks for options in ipt_LOG

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarHarald Welte <laforge@netfilter.org>
Signed-off-by: default avatarDavid S. Miller <davem@redhat.com>
parent afb7238d
...@@ -76,7 +76,7 @@ static void dump_packet(const struct ipt_log_info *info, ...@@ -76,7 +76,7 @@ static void dump_packet(const struct ipt_log_info *info,
printk("FRAG:%u ", ntohs(iph.frag_off) & IP_OFFSET); printk("FRAG:%u ", ntohs(iph.frag_off) & IP_OFFSET);
if ((info->logflags & IPT_LOG_IPOPT) if ((info->logflags & IPT_LOG_IPOPT)
&& iph.ihl * 4 != sizeof(struct iphdr)) { && iph.ihl * 4 > sizeof(struct iphdr)) {
unsigned char opt[4 * 15 - sizeof(struct iphdr)]; unsigned char opt[4 * 15 - sizeof(struct iphdr)];
unsigned int i, optsize; unsigned int i, optsize;
...@@ -143,7 +143,7 @@ static void dump_packet(const struct ipt_log_info *info, ...@@ -143,7 +143,7 @@ static void dump_packet(const struct ipt_log_info *info,
printk("URGP=%u ", ntohs(tcph.urg_ptr)); printk("URGP=%u ", ntohs(tcph.urg_ptr));
if ((info->logflags & IPT_LOG_TCPOPT) if ((info->logflags & IPT_LOG_TCPOPT)
&& tcph.doff * 4 != sizeof(struct tcphdr)) { && tcph.doff * 4 > sizeof(struct tcphdr)) {
unsigned char opt[4 * 15 - sizeof(struct tcphdr)]; unsigned char opt[4 * 15 - sizeof(struct tcphdr)];
unsigned int i, optsize; unsigned int i, optsize;
......
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