Skip to content

Commit 4ff0308

Browse files
committed
esp: Fix error handling on layer 2 xmit.
esp_output_tail() and esp6_output_tail() can return negative and positive error values. We currently treat only negative values as errors, fix this to treat both cases as error. Fixes: fca11eb ("esp4: Reorganize esp_output") Fixes: 383d035 ("esp6: Reorganize esp_output") Signed-off-by: Steffen Klassert <[email protected]>
1 parent 7bab096 commit 4ff0308

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

net/ipv4/esp4_offload.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static int esp_xmit(struct xfrm_state *x, struct sk_buff *skb, netdev_features_
257257
esp.seqno = cpu_to_be64(xo->seq.low + ((u64)xo->seq.hi << 32));
258258

259259
err = esp_output_tail(x, skb, &esp);
260-
if (err < 0)
260+
if (err)
261261
return err;
262262

263263
secpath_reset(skb);

net/ipv6/esp6_offload.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ static int esp6_xmit(struct xfrm_state *x, struct sk_buff *skb, netdev_features
286286
esp.seqno = cpu_to_be64(xo->seq.low + ((u64)xo->seq.hi << 32));
287287

288288
err = esp6_output_tail(x, skb, &esp);
289-
if (err < 0)
289+
if (err)
290290
return err;
291291

292292
secpath_reset(skb);

0 commit comments

Comments
 (0)