c
int ip6_output(struct net *net, struct sock *sk, struct sk_buff *skb)
{
    // ... (other code)
    struct inet6_dev *idev = ip6_dst_idev(skb_dst(skb));

    if (!idev) {
        return -ENODEV; // Or another appropriate error code
    }

    if (unlikely(READ_ONCE(idev->cnf.disable_ipv6))) {
        // ...
    }
    // ...
}
