Commit 56db1c5f authored by Jean Sacren's avatar Jean Sacren Committed by David S. Miller

mcast: do not check 'rv' twice in a row

With the loop, don't check 'rv' twice in a row. Without the loop, 'rv'
doesn't even need to be checked.

Make the comment more grammar-friendly.
Signed-off-by: default avatarJean Sacren <sakiwit@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 25cc4ae9
...@@ -427,11 +427,9 @@ int ip6_mc_source(int add, int omode, struct sock *sk, ...@@ -427,11 +427,9 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
rv = 1; /* > 0 for insert logic below if sl_count is 0 */ rv = 1; /* > 0 for insert logic below if sl_count is 0 */
for (i=0; i<psl->sl_count; i++) { for (i=0; i<psl->sl_count; i++) {
rv = !ipv6_addr_equal(&psl->sl_addr[i], source); rv = !ipv6_addr_equal(&psl->sl_addr[i], source);
if (rv == 0) if (rv == 0) /* There is an error in the address. */
break;
}
if (rv == 0) /* address already there is an error */
goto done; goto done;
}
for (j=psl->sl_count-1; j>=i; j--) for (j=psl->sl_count-1; j>=i; j--)
psl->sl_addr[j+1] = psl->sl_addr[j]; psl->sl_addr[j+1] = psl->sl_addr[j];
psl->sl_addr[i] = *source; psl->sl_addr[i] = *source;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment