aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/xfrm/xfrm_output.c')
-rw-r--r--net/xfrm/xfrm_output.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index 6f5fc612b162..3bb2cdc13b46 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -216,9 +216,17 @@ int xfrm_inner_extract_output(struct xfrm_state *x, struct sk_buff *skb)
216 216
217void xfrm_local_error(struct sk_buff *skb, int mtu) 217void xfrm_local_error(struct sk_buff *skb, int mtu)
218{ 218{
219 unsigned int proto;
219 struct xfrm_state_afinfo *afinfo; 220 struct xfrm_state_afinfo *afinfo;
220 221
221 afinfo = xfrm_state_get_afinfo(skb->sk->sk_family); 222 if (skb->protocol == htons(ETH_P_IP))
223 proto = AF_INET;
224 else if (skb->protocol == htons(ETH_P_IPV6))
225 proto = AF_INET6;
226 else
227 return;
228
229 afinfo = xfrm_state_get_afinfo(proto);
222 if (!afinfo) 230 if (!afinfo)
223 return; 231 return;
224 232