diff options
| author | Herbert Xu <herbert@gondor.apana.org.au> | 2003-06-12 03:41:03 -0700 |
|---|---|---|
| committer | David S. Miller <davem@nuts.ninka.net> | 2003-06-12 03:41:03 -0700 |
| commit | f1f080f892527bed86f794e037ed4874aa950737 (patch) | |
| tree | 70c36374ae9c8fcb9fac55d44942069061f81801 /net | |
| parent | 4cd7bfcc353069e956917ede8dacb3bf11937c0f (diff) | |
[IPSEC]: Initialize flow key properly in decode_session.
Diffstat (limited to 'net')
| -rw-r--r-- | net/ipv4/xfrm4_policy.c | 3 | ||||
| -rw-r--r-- | net/ipv6/xfrm6_policy.c | 1 |
2 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c index 2135ee473a2d..3de2d008ee12 100644 --- a/net/ipv4/xfrm4_policy.c +++ b/net/ipv4/xfrm4_policy.c @@ -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; diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index b9b57b2f928b..a13091a74149 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c @@ -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); |
