Version: 1
-Previous: ac935341b303c5fdb1075a60df7bab521d56f4a4
-Head: 8362303c82cb2d32d45494bd88b7c8a6e0fdf82d
+Previous: 352f548ea521419bb028f739b0a3897b720e8cfd
+Head: 4719d11c299e0a0aad43cdc73a672373f0ba68fe
Applied:
rmcfg: 84d811fcdc9f212f243f82594d613b68aea367c4
acm_notes-txt-change-dos-forma: d76f683c246786876219d6db213643600734d894
add-the-ability-to-preload-the: 0536bcd1611e365b2aeb7fd2fa68cec9ee1922b0
add-description-of-preloading-: 5765f7d237b191c036c032e0c4beb00123f68baf
increase-buffer-space-for-inet: 70596420225d4a1a4fac908e56eb9578e18a8994
- ib_acme-c-support-ipv6-address: 4346db471bb2cccdb4fb2bc328ea8272f2e0e376
- refresh-temp: 8362303c82cb2d32d45494bd88b7c8a6e0fdf82d
+ ib_acme-c-support-ipv6-address: 4719d11c299e0a0aad43cdc73a672373f0ba68fe
Unapplied:
convert-linux-header-files-fro: aed0b8ab0d23ffa04905fcc3750fa7936cd1bf05
add-support-for-preloading-ipv: a8e1f8072435c8beae5fe6cdc91c993b7134b4bd
Bottom: 0a2dea967d01d2c424b8332f5570dbaaad1609b8
-Top: 3a44416e854820cec923e458ae406c5a49a36e74
+Top: ccf28eb1b615b3a30bdf8689c0ae21f257bf169b
Author: Hal Rosenstock <hal@mellanox.com>
Date: 2013-06-20 00:18:23 +0300
---
diff --git a/src/acme.c b/src/acme.c
-index 8bdb938..9e30dc7 100644
+index 8bdb938..98b7153 100644
--- a/src/acme.c
+++ b/src/acme.c
-@@ -480,29 +480,52 @@ static int resolve_ip(struct ibv_path_record *path)
+@@ -476,34 +476,55 @@ static uint32_t get_resolve_flags()
+ return flags;
+ }
+
++static int inet_any_pton(char *addr, struct sockaddr *sa)
++{
++ struct sockaddr_in *sin;
++ struct sockaddr_in6 *sin6;
++ int ret;
++
++ sin = (struct sockaddr_in *) sa;
++ sa->sa_family = AF_INET;
++ ret = inet_pton(AF_INET, addr, &sin->sin_addr);
++ if (ret <= 0) {
++ sin6 = (struct sockaddr_in6 *) sa;
++ sa->sa_family = AF_INET6;
++ ret = inet_pton(AF_INET6, src_addr, &sin6->sin6_addr);
++ }
++
++ return ret;
++}
++
+ static int resolve_ip(struct ibv_path_record *path)
{
struct ibv_path_data *paths;
- struct sockaddr_in src, dest;
-+ struct sockaddr_in6 src6, dest6;
+- struct sockaddr_in src, dest;
++ struct sockaddr_storage src, dest;
struct sockaddr *saddr;
int ret, count;
-+ int is_ipv6_src, is_ipv6_dest;
if (src_addr) {
-+ is_ipv6_src = 0;
- src.sin_family = AF_INET;
- ret = inet_pton(AF_INET, src_addr, &src.sin_addr);
+- src.sin_family = AF_INET;
+- ret = inet_pton(AF_INET, src_addr, &src.sin_addr);
++ saddr = (struct sockaddr *) &src;
++ ret = inet_any_pton(src_addr, saddr);
if (ret <= 0) {
-- printf("inet_pton error on source address (%s): 0x%x\n", src_addr, ret);
-- return -1;
-+ src6.sin6_family = AF_INET6;
-+ ret = inet_pton(AF_INET6, src_addr, &src6.sin6_addr);
-+ if (ret <= 0) {
-+ printf("inet_pton error on source address (%s): 0x%x\n", src_addr, ret);
-+ return -1;
-+ }
-+ is_ipv6_src = 1;
+ printf("inet_pton error on source address (%s): 0x%x\n", src_addr, ret);
+ return -1;
}
- saddr = (struct sockaddr *) &src;
-+ if (is_ipv6_src)
-+ saddr = (struct sockaddr *) &src6;
-+ else
-+ saddr = (struct sockaddr *) &src;
} else {
saddr = NULL;
}
-+ is_ipv6_dest = 0;
- dest.sin_family = AF_INET;
- ret = inet_pton(AF_INET, dest_addr, &dest.sin_addr);
+- dest.sin_family = AF_INET;
+- ret = inet_pton(AF_INET, dest_addr, &dest.sin_addr);
++ ret = inet_any_pton(dest_addr, (struct sockaddr *) &dest);
if (ret <= 0) {
-- printf("inet_pton error on destination address (%s): 0x%x\n", dest_addr, ret);
-+ dest6.sin6_family = AF_INET6;
-+ ret = inet_pton(AF_INET6, dest_addr, &dest6.sin6_addr);
-+ if (ret <= 0) {
-+ printf("inet_pton error on destination address (%s): 0x%x\n", dest_addr, ret);
-+ return -1;
-+ }
-+ is_ipv6_dest = 1;
-+ }
-+
-+ if (src_addr && is_ipv6_src != is_ipv6_dest) {
-+ printf("source and destination address families don't match\n");
+ printf("inet_pton error on destination address (%s): 0x%x\n", dest_addr, ret);
return -1;
}
- ret = ib_acm_resolve_ip(saddr, (struct sockaddr *) &dest,
-+ ret = ib_acm_resolve_ip(saddr,
-+ (is_ipv6_dest ? (struct sockaddr *) &dest6 : (struct sockaddr *) &dest),
- &paths, &count, get_resolve_flags());
+- &paths, &count, get_resolve_flags());
++ if (src_addr && src.ss_family != dest.ss_family) {
++ printf("source and destination address families don't match\n");
++ return -1;
++ }
++
++ ret = ib_acm_resolve_ip(saddr, (struct sockaddr *) &dest), &paths,
++ &count, get_resolve_flags());
if (ret) {
printf("ib_acm_resolve_ip failed: %s\n", strerror(errno));
+ return ret;
+++ /dev/null
-Bottom: 3a44416e854820cec923e458ae406c5a49a36e74
-Top: ccf28eb1b615b3a30bdf8689c0ae21f257bf169b
-Author: Sean Hefty <sean.hefty@intel.com>
-Date: 2013-06-27 23:25:29 -0700
-
-Refresh of ib_acme-c-support-ipv6-address
-
----
-
-diff --git a/src/acme.c b/src/acme.c
-index 9e30dc7..98b7153 100644
---- a/src/acme.c
-+++ b/src/acme.c
-@@ -476,57 +476,55 @@ static uint32_t get_resolve_flags()
- return flags;
- }
-
-+static int inet_any_pton(char *addr, struct sockaddr *sa)
-+{
-+ struct sockaddr_in *sin;
-+ struct sockaddr_in6 *sin6;
-+ int ret;
-+
-+ sin = (struct sockaddr_in *) sa;
-+ sa->sa_family = AF_INET;
-+ ret = inet_pton(AF_INET, addr, &sin->sin_addr);
-+ if (ret <= 0) {
-+ sin6 = (struct sockaddr_in6 *) sa;
-+ sa->sa_family = AF_INET6;
-+ ret = inet_pton(AF_INET6, src_addr, &sin6->sin6_addr);
-+ }
-+
-+ return ret;
-+}
-+
- static int resolve_ip(struct ibv_path_record *path)
- {
- struct ibv_path_data *paths;
-- struct sockaddr_in src, dest;
-- struct sockaddr_in6 src6, dest6;
-+ struct sockaddr_storage src, dest;
- struct sockaddr *saddr;
- int ret, count;
-- int is_ipv6_src, is_ipv6_dest;
-
- if (src_addr) {
-- is_ipv6_src = 0;
-- src.sin_family = AF_INET;
-- ret = inet_pton(AF_INET, src_addr, &src.sin_addr);
-+ saddr = (struct sockaddr *) &src;
-+ ret = inet_any_pton(src_addr, saddr);
- if (ret <= 0) {
-- src6.sin6_family = AF_INET6;
-- ret = inet_pton(AF_INET6, src_addr, &src6.sin6_addr);
-- if (ret <= 0) {
-- printf("inet_pton error on source address (%s): 0x%x\n", src_addr, ret);
-- return -1;
-- }
-- is_ipv6_src = 1;
-+ printf("inet_pton error on source address (%s): 0x%x\n", src_addr, ret);
-+ return -1;
- }
-- if (is_ipv6_src)
-- saddr = (struct sockaddr *) &src6;
-- else
-- saddr = (struct sockaddr *) &src;
- } else {
- saddr = NULL;
- }
-
-- is_ipv6_dest = 0;
-- dest.sin_family = AF_INET;
-- ret = inet_pton(AF_INET, dest_addr, &dest.sin_addr);
-+ ret = inet_any_pton(dest_addr, (struct sockaddr *) &dest);
- if (ret <= 0) {
-- dest6.sin6_family = AF_INET6;
-- ret = inet_pton(AF_INET6, dest_addr, &dest6.sin6_addr);
-- if (ret <= 0) {
-- printf("inet_pton error on destination address (%s): 0x%x\n", dest_addr, ret);
-- return -1;
-- }
-- is_ipv6_dest = 1;
-+ printf("inet_pton error on destination address (%s): 0x%x\n", dest_addr, ret);
-+ return -1;
- }
-
-- if (src_addr && is_ipv6_src != is_ipv6_dest) {
-+ if (src_addr && src.ss_family != dest.ss_family) {
- printf("source and destination address families don't match\n");
- return -1;
- }
-
-- ret = ib_acm_resolve_ip(saddr,
-- (is_ipv6_dest ? (struct sockaddr *) &dest6 : (struct sockaddr *) &dest),
-- &paths, &count, get_resolve_flags());
-+ ret = ib_acm_resolve_ip(saddr, (struct sockaddr *) &dest), &paths,
-+ &count, get_resolve_flags());
- if (ret) {
- printf("ib_acm_resolve_ip failed: %s\n", strerror(errno));
- return ret;