Commit f1f080f8 authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

[IPSEC]: Initialize flow key properly in decode_session.

parent 4cd7bfcc
......@@ -172,6 +172,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl)
struct iphdr *iph = skb->nh.iph;
u8 *xprth = skb->nh.raw + iph->ihl*4;
memset(fl, 0, sizeof(struct flowi));
if (!(iph->frag_off & htons(IP_MF | IP_OFFSET))) {
switch (iph->protocol) {
case IPPROTO_UDP:
......@@ -212,8 +213,6 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl)
fl->fl_ipsec_spi = 0;
break;
};
} else {
memset(fl, 0, sizeof(struct flowi));
}
fl->proto = iph->protocol;
fl->fl4_dst = iph->daddr;
......
......@@ -177,6 +177,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl)
struct ipv6_opt_hdr *exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset);
u8 nexthdr = skb->nh.ipv6h->nexthdr;
memset(fl, 0, sizeof(struct flowi));
ipv6_addr_copy(&fl->fl6_dst, &hdr->daddr);
ipv6_addr_copy(&fl->fl6_src, &hdr->saddr);
......
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