OSDN Git Service

Merge tag 'for-4.21/block-20181221' of git://git.kernel.dk/linux-block
[uclinux-h8/linux.git] / net / sctp / ipv6.c
index 7f0539d..b9ed271 100644 (file)
@@ -139,7 +139,7 @@ static struct notifier_block sctp_inet6addr_notifier = {
 };
 
 /* ICMP error handler. */
-static void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
+static int sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
                        u8 type, u8 code, int offset, __be32 info)
 {
        struct inet6_dev *idev;
@@ -148,7 +148,7 @@ static void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
        struct sctp_transport *transport;
        struct ipv6_pinfo *np;
        __u16 saveip, savesctp;
-       int err;
+       int err, ret = 0;
        struct net *net = dev_net(skb->dev);
 
        idev = in6_dev_get(skb->dev);
@@ -164,6 +164,7 @@ static void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
        skb->transport_header = savesctp;
        if (!sk) {
                __ICMP6_INC_STATS(net, idev, ICMP6_MIB_INERRORS);
+               ret = -ENOENT;
                goto out;
        }
 
@@ -203,6 +204,8 @@ out_unlock:
 out:
        if (likely(idev != NULL))
                in6_dev_put(idev);
+
+       return ret;
 }
 
 static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport)