]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
RDS: active bonding needs to set brcast and mask for its primary interface
authorChien-Hua Yen <chien.yen@oracle.com>
Fri, 7 Mar 2014 06:59:15 +0000 (22:59 -0800)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Wed, 8 Jul 2015 20:59:48 +0000 (13:59 -0700)
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 <chien.yen@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
(cherry picked from commit 5cad478d7148ac4b6fc2d6eb78d6bf5a576d69e1)

net/rds/ib.c

index 628430bdd83a191e0e7a54a36f2ee4bf917bfcb4..69f2e89ea28b16a5576f11277d5f398eef83bd1b 100644 (file)
@@ -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) {