diff options
Diffstat (limited to 'net/xfrm/xfrm_user.c')
-rw-r--r-- | net/xfrm/xfrm_user.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index b43e7647e125..2ee14f8a1908 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -495,6 +495,7 @@ static struct xfrm_state *xfrm_user_state_lookup(struct xfrm_usersa_id *p, | |||
495 | goto out; | 495 | goto out; |
496 | } | 496 | } |
497 | 497 | ||
498 | err = -ESRCH; | ||
498 | x = xfrm_state_lookup_byaddr(&p->daddr, saddr, p->proto, | 499 | x = xfrm_state_lookup_byaddr(&p->daddr, saddr, p->proto, |
499 | p->family); | 500 | p->family); |
500 | } | 501 | } |
@@ -1927,6 +1928,9 @@ static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt, | |||
1927 | len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr); | 1928 | len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr); |
1928 | len += NLMSG_SPACE(sizeof(struct xfrm_user_acquire)); | 1929 | len += NLMSG_SPACE(sizeof(struct xfrm_user_acquire)); |
1929 | len += RTA_SPACE(xfrm_user_sec_ctx_size(xp)); | 1930 | len += RTA_SPACE(xfrm_user_sec_ctx_size(xp)); |
1931 | #ifdef CONFIG_XFRM_SUB_POLICY | ||
1932 | len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type)); | ||
1933 | #endif | ||
1930 | skb = alloc_skb(len, GFP_ATOMIC); | 1934 | skb = alloc_skb(len, GFP_ATOMIC); |
1931 | if (skb == NULL) | 1935 | if (skb == NULL) |
1932 | return -ENOMEM; | 1936 | return -ENOMEM; |
@@ -2034,6 +2038,9 @@ static int xfrm_exp_policy_notify(struct xfrm_policy *xp, int dir, struct km_eve | |||
2034 | len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr); | 2038 | len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr); |
2035 | len += NLMSG_SPACE(sizeof(struct xfrm_user_polexpire)); | 2039 | len += NLMSG_SPACE(sizeof(struct xfrm_user_polexpire)); |
2036 | len += RTA_SPACE(xfrm_user_sec_ctx_size(xp)); | 2040 | len += RTA_SPACE(xfrm_user_sec_ctx_size(xp)); |
2041 | #ifdef CONFIG_XFRM_SUB_POLICY | ||
2042 | len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type)); | ||
2043 | #endif | ||
2037 | skb = alloc_skb(len, GFP_ATOMIC); | 2044 | skb = alloc_skb(len, GFP_ATOMIC); |
2038 | if (skb == NULL) | 2045 | if (skb == NULL) |
2039 | return -ENOMEM; | 2046 | return -ENOMEM; |
@@ -2060,6 +2067,9 @@ static int xfrm_notify_policy(struct xfrm_policy *xp, int dir, struct km_event * | |||
2060 | len += RTA_SPACE(headlen); | 2067 | len += RTA_SPACE(headlen); |
2061 | headlen = sizeof(*id); | 2068 | headlen = sizeof(*id); |
2062 | } | 2069 | } |
2070 | #ifdef CONFIG_XFRM_SUB_POLICY | ||
2071 | len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type)); | ||
2072 | #endif | ||
2063 | len += NLMSG_SPACE(headlen); | 2073 | len += NLMSG_SPACE(headlen); |
2064 | 2074 | ||
2065 | skb = alloc_skb(len, GFP_ATOMIC); | 2075 | skb = alloc_skb(len, GFP_ATOMIC); |
@@ -2106,10 +2116,12 @@ static int xfrm_notify_policy_flush(struct km_event *c) | |||
2106 | struct nlmsghdr *nlh; | 2116 | struct nlmsghdr *nlh; |
2107 | struct sk_buff *skb; | 2117 | struct sk_buff *skb; |
2108 | unsigned char *b; | 2118 | unsigned char *b; |
2119 | int len = 0; | ||
2109 | #ifdef CONFIG_XFRM_SUB_POLICY | 2120 | #ifdef CONFIG_XFRM_SUB_POLICY |
2110 | struct xfrm_userpolicy_type upt; | 2121 | struct xfrm_userpolicy_type upt; |
2122 | len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type)); | ||
2111 | #endif | 2123 | #endif |
2112 | int len = NLMSG_LENGTH(0); | 2124 | len += NLMSG_LENGTH(0); |
2113 | 2125 | ||
2114 | skb = alloc_skb(len, GFP_ATOMIC); | 2126 | skb = alloc_skb(len, GFP_ATOMIC); |
2115 | if (skb == NULL) | 2127 | if (skb == NULL) |