OSDN Git Service

net: Convert protocol error handlers from void to int
[tomoyo/tomoyo-test1.git] / net / ipv4 / xfrm4_protocol.c
index 8dd0e6a..35c5486 100644 (file)
@@ -106,13 +106,15 @@ static int xfrm4_esp_rcv(struct sk_buff *skb)
        return 0;
 }
 
-static void xfrm4_esp_err(struct sk_buff *skb, u32 info)
+static int xfrm4_esp_err(struct sk_buff *skb, u32 info)
 {
        struct xfrm4_protocol *handler;
 
        for_each_protocol_rcu(esp4_handlers, handler)
                if (!handler->err_handler(skb, info))
-                       break;
+                       return 0;
+
+       return -ENOENT;
 }
 
 static int xfrm4_ah_rcv(struct sk_buff *skb)
@@ -132,13 +134,15 @@ static int xfrm4_ah_rcv(struct sk_buff *skb)
        return 0;
 }
 
-static void xfrm4_ah_err(struct sk_buff *skb, u32 info)
+static int xfrm4_ah_err(struct sk_buff *skb, u32 info)
 {
        struct xfrm4_protocol *handler;
 
        for_each_protocol_rcu(ah4_handlers, handler)
                if (!handler->err_handler(skb, info))
-                       break;
+                       return 0;
+
+       return -ENOENT;
 }
 
 static int xfrm4_ipcomp_rcv(struct sk_buff *skb)
@@ -158,13 +162,15 @@ static int xfrm4_ipcomp_rcv(struct sk_buff *skb)
        return 0;
 }
 
-static void xfrm4_ipcomp_err(struct sk_buff *skb, u32 info)
+static int xfrm4_ipcomp_err(struct sk_buff *skb, u32 info)
 {
        struct xfrm4_protocol *handler;
 
        for_each_protocol_rcu(ipcomp4_handlers, handler)
                if (!handler->err_handler(skb, info))
-                       break;
+                       return 0;
+
+       return -ENOENT;
 }
 
 static const struct net_protocol esp4_protocol = {