]> Pileus Git - ~andy/linux/blobdiff - drivers/net/ppp/pppoe.c
net: rework recvmsg handler msg_name and msg_namelen logic
[~andy/linux] / drivers / net / ppp / pppoe.c
index bb07ba94c3aaedb8949c310d340c18ae1b9ab284..82ee6ed954cb84272aa41be0fa3ad12eb6c64e2c 100644 (file)
@@ -338,7 +338,7 @@ static void pppoe_flush_dev(struct net_device *dev)
 static int pppoe_device_event(struct notifier_block *this,
                              unsigned long event, void *ptr)
 {
-       struct net_device *dev = (struct net_device *)ptr;
+       struct net_device *dev = netdev_notifier_info_to_dev(ptr);
 
        /* Only look at sockets that are using this specific device. */
        switch (event) {
@@ -979,8 +979,6 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock,
        if (error < 0)
                goto end;
 
-       m->msg_namelen = 0;
-
        if (skb) {
                total_len = min_t(size_t, total_len, skb->len);
                error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len);