Commit 3577484e authored by James Morris's avatar James Morris Committed by David S. Miller

[IPSEC]: return error when no dst in ah & esp output.

parent b952a29d
...@@ -141,8 +141,10 @@ static int ah_output(struct sk_buff *skb) ...@@ -141,8 +141,10 @@ static int ah_output(struct sk_buff *skb)
x->curlft.bytes += skb->len; x->curlft.bytes += skb->len;
x->curlft.packets++; x->curlft.packets++;
spin_unlock_bh(&x->lock); spin_unlock_bh(&x->lock);
if ((skb->dst = dst_pop(dst)) == NULL) if ((skb->dst = dst_pop(dst)) == NULL) {
err = -EHOSTUNREACH;
goto error_nolock; goto error_nolock;
}
return NET_XMIT_BYPASS; return NET_XMIT_BYPASS;
error: error:
......
...@@ -145,8 +145,10 @@ int esp_output(struct sk_buff *skb) ...@@ -145,8 +145,10 @@ int esp_output(struct sk_buff *skb)
x->curlft.bytes += skb->len; x->curlft.bytes += skb->len;
x->curlft.packets++; x->curlft.packets++;
spin_unlock_bh(&x->lock); spin_unlock_bh(&x->lock);
if ((skb->dst = dst_pop(dst)) == NULL) if ((skb->dst = dst_pop(dst)) == NULL) {
err = -EHOSTUNREACH;
goto error_nolock; goto error_nolock;
}
return NET_XMIT_BYPASS; return NET_XMIT_BYPASS;
error: error:
......
...@@ -136,8 +136,10 @@ int ah6_output(struct sk_buff *skb) ...@@ -136,8 +136,10 @@ int ah6_output(struct sk_buff *skb)
x->curlft.bytes += skb->len; x->curlft.bytes += skb->len;
x->curlft.packets++; x->curlft.packets++;
spin_unlock_bh(&x->lock); spin_unlock_bh(&x->lock);
if ((skb->dst = dst_pop(dst)) == NULL) if ((skb->dst = dst_pop(dst)) == NULL) {
err = -EHOSTUNREACH;
goto error_nolock; goto error_nolock;
}
return NET_XMIT_BYPASS; return NET_XMIT_BYPASS;
error: error:
spin_unlock_bh(&x->lock); spin_unlock_bh(&x->lock);
......
...@@ -241,8 +241,10 @@ int esp6_output(struct sk_buff *skb) ...@@ -241,8 +241,10 @@ int esp6_output(struct sk_buff *skb)
x->curlft.bytes += skb->len; x->curlft.bytes += skb->len;
x->curlft.packets++; x->curlft.packets++;
spin_unlock_bh(&x->lock); spin_unlock_bh(&x->lock);
if ((skb->dst = dst_pop(dst)) == NULL) if ((skb->dst = dst_pop(dst)) == NULL) {
err = -EHOSTUNREACH;
goto error_nolock; goto error_nolock;
}
return NET_XMIT_BYPASS; return NET_XMIT_BYPASS;
error: error:
......
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