OSDN Git Service

net: Convert protocol error handlers from void to int
[tomoyo/tomoyo-test1.git] / net / ipv4 / gre_demux.c
index 7efe740..a4bf22e 100644 (file)
@@ -151,20 +151,25 @@ drop:
        return NET_RX_DROP;
 }
 
-static void gre_err(struct sk_buff *skb, u32 info)
+static int gre_err(struct sk_buff *skb, u32 info)
 {
        const struct gre_protocol *proto;
        const struct iphdr *iph = (const struct iphdr *)skb->data;
        u8 ver = skb->data[(iph->ihl<<2) + 1]&0x7f;
+       int err = 0;
 
        if (ver >= GREPROTO_MAX)
-               return;
+               return -EINVAL;
 
        rcu_read_lock();
        proto = rcu_dereference(gre_proto[ver]);
        if (proto && proto->err_handler)
                proto->err_handler(skb, info);
+       else
+               err = -EPROTONOSUPPORT;
        rcu_read_unlock();
+
+       return err;
 }
 
 static const struct net_protocol net_gre_protocol = {