bonding: documentation and code cleanup for resend_igmp

Improves the documentation about how IGMP resend parameter
works, fix two missing checks and coding style issues.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Acked-by: Rick Jones <rick.jones2@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Flavio Leitner
2011-05-25 08:38:58 +00:00
committed by David S. Miller
parent 9fe0617d9b
commit 94265cf5f7
3 changed files with 23 additions and 12 deletions

View File

@@ -1533,8 +1533,8 @@ static DEVICE_ATTR(all_slaves_active, S_IRUGO | S_IWUSR,
* Show and set the number of IGMP membership reports to send on link failure
*/
static ssize_t bonding_show_resend_igmp(struct device *d,
struct device_attribute *attr,
char *buf)
struct device_attribute *attr,
char *buf)
{
struct bonding *bond = to_bond(d);
@@ -1542,8 +1542,8 @@ static ssize_t bonding_show_resend_igmp(struct device *d,
}
static ssize_t bonding_store_resend_igmp(struct device *d,
struct device_attribute *attr,
const char *buf, size_t count)
struct device_attribute *attr,
const char *buf, size_t count)
{
int new_value, ret = count;
struct bonding *bond = to_bond(d);
@@ -1555,7 +1555,7 @@ static ssize_t bonding_store_resend_igmp(struct device *d,
goto out;
}
if (new_value < 0) {
if (new_value < 0 || new_value > 255) {
pr_err("%s: Invalid resend_igmp value %d not in range 0-255; rejected.\n",
bond->dev->name, new_value);
ret = -EINVAL;