ipv6: Allow inet6_dump_addr() to handle more than 64 addresses
authorEric Dumazet <eric.dumazet@gmail.com>
Mon, 9 Nov 2009 07:40:17 +0000 (07:40 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Nov 2009 04:54:42 +0000 (20:54 -0800)
Apparently, inet6_dump_addr() is not able to handle more than
64 ipv6 addresses per device. We must break from inner loops
in case skb is full, or else cursor is put at the end of list.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/addrconf.c

index f9f7fd6ee1f3f1f68aeb6cb7e49c503bd7504124..0ab39fedd2dc3bbff6e9a2d654ff6c202a8e0ce3 100644 (file)
@@ -3519,6 +3519,8 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb,
                                                        cb->nlh->nlmsg_seq,
                                                        RTM_NEWADDR,
                                                        NLM_F_MULTI);
+                               if (err <= 0)
+                                       break;
                        }
                        break;
                case MULTICAST_ADDR:
@@ -3532,6 +3534,8 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb,
                                                          cb->nlh->nlmsg_seq,
                                                          RTM_GETMULTICAST,
                                                          NLM_F_MULTI);
+                               if (err <= 0)
+                                       break;
                        }
                        break;
                case ANYCAST_ADDR:
@@ -3545,6 +3549,8 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb,
                                                          cb->nlh->nlmsg_seq,
                                                          RTM_GETANYCAST,
                                                          NLM_F_MULTI);
+                               if (err <= 0)
+                                       break;
                        }
                        break;
                default: