[1/1] addrconf.c: Prevent missing IPv6 addresses

Submitted by Brad Figg on Dec. 16, 2011, 7:27 p.m.

Details

Message ID 1324063620-4185-2-git-send-email-brad.figg@canonical.com
State New
Headers show

Commit Message

Brad Figg Dec. 16, 2011, 7:27 p.m.
From: Neil Wilson <neil@brightbox.co.uk>

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

Commit 5d5619b40c2474de01c64bdf6bb9f1211d3e967a introduced an
error that prevents certain IPv6 addresses showing up in netlink
'dump' listings. This patch backports the corrections from commit
234b27c3fd58fc0e15c04dd0fbf4337fac9c2a06
Signed-off-by: Brad Figg <brad.figg@canonical.com>
---
 net/ipv6/addrconf.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

Comments

Seth Forshee Dec. 16, 2011, 7:49 p.m.
On Fri, Dec 16, 2011 at 11:27:00AM -0800, Brad Figg wrote:
> From: Neil Wilson <neil@brightbox.co.uk>
> 
> BugLink: http://bugs.launchpad.net/bugs/863394
> 
> Commit 5d5619b40c2474de01c64bdf6bb9f1211d3e967a introduced an
> error that prevents certain IPv6 addresses showing up in netlink
> 'dump' listings. This patch backports the corrections from commit
> 234b27c3fd58fc0e15c04dd0fbf4337fac9c2a06

Those breaks had already been added prior to
234b27c3fd58fc0e15c04dd0fbf4337fac9c2a06. You should be able to get
exactly what's needed here by cherry picking
bcd323262a94b14b84341982b90443a76a477861. And as an added bonus, the
indentation will be correct.

> Signed-off-by: Brad Figg <brad.figg@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..a5386de 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 hide | download patch | download mbox

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 8ac3d09..a5386de 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: