From: Chien-Hua Yen Date: Fri, 7 Mar 2014 06:59:15 +0000 (-0800) Subject: RDS: active bonding needs to set brcast and mask for its primary interface X-Git-Tag: v4.1.12-92~293^2^2~42 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1577644654a7d0c4ff2899809d897a8c6eea048b;p=users%2Fjedix%2Flinux-maple.git RDS: active bonding needs to set brcast and mask for its primary interface Only IP address is set in the current implementation. This patch adds the setting for broadcast address and netmask of failback interface. Orabug: 18479088 Signed-off-by: Chien-Hua Yen Signed-off-by: Bang Nguyen (cherry picked from commit 5cad478d7148ac4b6fc2d6eb78d6bf5a576d69e1) --- diff --git a/net/rds/ib.c b/net/rds/ib.c index 628430bdd83a1..69f2e89ea28b1 100644 --- a/net/rds/ib.c +++ b/net/rds/ib.c @@ -486,7 +486,7 @@ static int rds_ib_set_ip(struct net_device *out_dev, (unsigned long) ir); if (ret) { printk(KERN_ERR - "RDS/IB: inet_ioctl(SIOCSIFBRDADDR) on %s failed (%d)\n", + "RDS/IB: inet_ioctl(SIOCSIFNETMASK) on %s failed (%d)\n", if_name, ret); goto out; } @@ -601,13 +601,20 @@ static int rds_ib_move_ip(char *from_dev, ret = inet_ioctl(rds_ib_inet_socket, SIOCGIFADDR, (unsigned long) ir); if (ret == -EADDRNOTAVAIL) { - sin->sin_addr.s_addr = ip_config[to_port].ip_addr; - ret = inet_ioctl(rds_ib_inet_socket, SIOCSIFADDR, - (unsigned long) ir); + /* Set the IP on new port */ + ret = rds_ib_set_ip(ip_config[arp_port].dev, + ip_config[to_port].dev->dev_addr, + ip_config[to_port].dev->name, + ip_config[to_port].ip_addr, + ip_config[to_port].ip_bcast, + ip_config[to_port].ip_mask); + if (ret) { printk(KERN_ERR - "RDS/IB: inet_ioctl(SIOCSIFADDR) " - "failed (%d)\n", ret); + "RDS/IP: failed to set IP %u.%u.%u.%u " + "on %s failed (%d)\n", + NIPQUAD(ip_config[to_port].ip_addr), + ip_config[to_port].dev->name, ret); goto out; } } else if (ret) {