Patchwork [1/1] ipv6: Allow inet6_dump_addr() to handle more than 64 addresses

login
register
mail settings
Submitter Brad Figg
Date Dec. 16, 2011, 9:37 p.m.
Message ID <1324071424-10815-2-git-send-email-brad.figg@canonical.com>
Download mbox | patch
Permalink /patch/131910/
State New
Headers show

Comments

Brad Figg - Dec. 16, 2011, 9:37 p.m.
From: Eric Dumazet <eric.dumazet@gmail.com>

BugLink: http://bugs.launchpad.net/bugs/863394

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>
Signed-off-by: Brad Figg <brad.figg@canonical.com>
(cherry picked from commit bcd323262a94b14b84341982b90443a76a477861)
---
 net/ipv6/addrconf.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
Seth Forshee - Dec. 16, 2011, 10:15 p.m.
On Fri, Dec 16, 2011 at 01:37:04PM -0800, Brad Figg wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/863394
> 
> 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>
> Signed-off-by: Brad Figg <brad.figg@canonical.com>
> (cherry picked from commit bcd323262a94b14b84341982b90443a76a477861)

Acked-by: Seth Forshee <seth.forshee@canonical.com>

> ---
>  net/ipv6/addrconf.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index 8ac3d09..e23be1f 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -3523,6 +3523,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:
> @@ -3536,6 +3538,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:
> @@ -3549,6 +3553,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:
> -- 
> 1.7.5.4
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

Patch

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 8ac3d09..e23be1f 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3523,6 +3523,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:
@@ -3536,6 +3538,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:
@@ -3549,6 +3553,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: