提交 88edf103 编写于 作者: L Lionel Gauthier 提交者: David S. Miller

gtp: gtp_check_src_ms_ipv4() always return success

gtp_check_src_ms_ipv4() did not find the PDP context matching with the
UE IP address because the memory location is not right, but the result
is inverted by the Boolean "not" operator.  So whatever is the PDP
context, any call to this function is successful.
Signed-off-by: NLionel Gauthier <Lionel.Gauthier@eurecom.fr>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e999cb43
......@@ -158,9 +158,9 @@ static bool gtp_check_src_ms_ipv4(struct sk_buff *skb, struct pdp_ctx *pctx,
if (!pskb_may_pull(skb, hdrlen + sizeof(struct iphdr)))
return false;
iph = (struct iphdr *)(skb->data + hdrlen + sizeof(struct iphdr));
iph = (struct iphdr *)(skb->data + hdrlen);
return iph->saddr != pctx->ms_addr_ip4.s_addr;
return iph->saddr == pctx->ms_addr_ip4.s_addr;
}
/* Check if the inner IP source address in this packet is assigned to any
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册