Merge branch 'mainstream'
[sliver-openvswitch.git] / lib / bond.c
index c202840..dc0d76b 100644 (file)
@@ -735,7 +735,7 @@ log_bals(struct bond *bond, const struct list *bals)
                     if (&e->list_node != list_front(&slave->entries)) {
                         ds_put_cstr(&ds, " + ");
                     }
-                    ds_put_format(&ds, "h%td: %"PRIu64"kB",
+                    ds_put_format(&ds, "h%"PRIdPTR": %"PRIu64"kB",
                                   e - bond->hash, e->tx_bytes / 1024);
                 }
                 ds_put_cstr(&ds, ")");
@@ -754,7 +754,7 @@ bond_shift_load(struct bond_entry *hash, struct bond_slave *to)
     struct bond *bond = from->bond;
     uint64_t delta = hash->tx_bytes;
 
-    VLOG_INFO("bond %s: shift %"PRIu64"kB of load (with hash %td) "
+    VLOG_INFO("bond %s: shift %"PRIu64"kB of load (with hash %"PRIdPTR") "
               "from %s to %s (now carrying %"PRIu64"kB and "
               "%"PRIu64"kB load, respectively)",
               bond->name, delta / 1024, hash - bond->hash,
@@ -1261,7 +1261,7 @@ bond_unixctl_hash(struct unixctl_conn *conn, int argc, const char *argv[],
     uint32_t basis;
 
     if (vlan_s) {
-        if (sscanf(vlan_s, "%u", &vlan) != 1) {
+        if (!ovs_scan(vlan_s, "%u", &vlan)) {
             unixctl_command_reply_error(conn, "invalid vlan");
             return;
         }
@@ -1270,7 +1270,7 @@ bond_unixctl_hash(struct unixctl_conn *conn, int argc, const char *argv[],
     }
 
     if (basis_s) {
-        if (sscanf(basis_s, "%"PRIu32, &basis) != 1) {
+        if (!ovs_scan(basis_s, "%"SCNu32, &basis)) {
             unixctl_command_reply_error(conn, "invalid basis");
             return;
         }
@@ -1278,8 +1278,7 @@ bond_unixctl_hash(struct unixctl_conn *conn, int argc, const char *argv[],
         basis = 0;
     }
 
-    if (sscanf(mac_s, ETH_ADDR_SCAN_FMT, ETH_ADDR_SCAN_ARGS(mac))
-        == ETH_ADDR_SCAN_COUNT) {
+    if (ovs_scan(mac_s, ETH_ADDR_SCAN_FMT, ETH_ADDR_SCAN_ARGS(mac))) {
         hash = bond_hash_src(mac, vlan, basis) & BOND_MASK;
 
         hash_cstr = xasprintf("%u", hash);