components/open-fabrics/libibmad/patches/base.patch
branchs11u1-sru
changeset 2385 b142cc36553d
parent 490 20074ee5793e
child 2462 1132a517894c
equal deleted inserted replaced
2384:213142545a23 2385:b142cc36553d
    87 -	memcpy(&val, ((char *)buf + base_offs + f->bitoffs / 8),
    87 -	memcpy(&val, ((char *)buf + base_offs + f->bitoffs / 8),
    88 +	memcpy( (void *)&val, (void *)((char *)buf + base_offs + f->bitoffs / 8),
    88 +	memcpy( (void *)&val, (void *)((char *)buf + base_offs + f->bitoffs / 8),
    89  	       sizeof(uint64_t));
    89  	       sizeof(uint64_t));
    90  	return ntohll(val);
    90  	return ntohll(val);
    91  }
    91  }
       
    92 diff -r -u /tmp/libibmad-1.3.7/src/resolve.c libibmad-1.3.7/src/resolve.c
       
    93 --- /tmp/libibmad-1.3.7/src/resolve.c	Wed Feb 16 02:12:53 2011
       
    94 +++ libibmad-1.3.7/src/resolve.c	Thu Oct  4 23:29:01 2012
       
    95 @@ -40,6 +40,7 @@
       
    96  #include <stdlib.h>
       
    97  #include <string.h>
       
    98  #include <arpa/inet.h>
       
    99 +#include <errno.h>
       
   100  
       
   101  #include <infiniband/umad.h>
       
   102  #include <infiniband/mad.h>
       
   103 @@ -104,12 +105,18 @@
       
   104  
       
   105  	if (!sm_id) {
       
   106  		sm_id = &sm_portid;
       
   107 -		if (ib_resolve_smlid_via(sm_id, timeout, srcport) < 0)
       
   108 +		if (ib_resolve_smlid_via(sm_id, timeout, srcport) < 0) {
       
   109 +			if (!errno)
       
   110 +				errno = EIO;
       
   111  			return -1;
       
   112 +		}
       
   113  	}
       
   114  
       
   115 -	if (!smp_query_via(nodeinfo, &self, IB_ATTR_NODE_INFO, 0, 0, srcport))
       
   116 +	if (!smp_query_via(nodeinfo, &self, IB_ATTR_NODE_INFO, 0, 0, srcport)) {
       
   117 +		if (!errno)
       
   118 +			errno = EIO;
       
   119  		return -1;
       
   120 +	}
       
   121  	mad_decode_field(nodeinfo, IB_NODE_PORT_GUID_F, &selfguid);
       
   122  	mad_set_field64(selfgid, 0, IB_GID_PREFIX_F, IB_DEFAULT_SUBN_PREFIX);
       
   123  	mad_set_field64(selfgid, 0, IB_GID_GUID_F, selfguid);
    92 diff -r -u /tmp/libibmad-1.3.7/src/dump.c libibmad-1.3.7/src/dump.c
   124 diff -r -u /tmp/libibmad-1.3.7/src/dump.c libibmad-1.3.7/src/dump.c
    93 --- /tmp/libibmad-1.3.7/src/dump.c	Wed Feb 16 02:12:53 2011
   125 --- /tmp/libibmad-1.3.7/src/dump.c	Wed Feb 16 02:12:53 2011
    94 +++ libibmad-1.3.7/src/dump.c	Thu Feb 24 11:27:11 2011
   126 +++ libibmad-1.3.7/src/dump.c	Thu Feb 24 11:27:11 2011
    95 @@ -46,12 +46,24 @@
   127 @@ -46,12 +46,24 @@
    96  
   128  
   203 +#endif /* _BIG_ENDIAN */
   235 +#endif /* _BIG_ENDIAN */
   204 +		snprintf(buf, bufsz, "%04x", *(uint16_t *) val & 0xffff);
   236 +		snprintf(buf, bufsz, "%04x", *(uint16_t *) val & 0xffff);
   205  		break;
   237  		break;
   206  	case 3:
   238  	case 3:
   207  		snprintf(buf, bufsz, "%06x", *(uint32_t *) val & 0xffffff);
   239  		snprintf(buf, bufsz, "%06x", *(uint32_t *) val & 0xffffff);
       
   240 diff -r -u /tmp/libibmad-1.3.7/src/sa.c libibmad-1.3.7/src/sa.c
       
   241 --- /tmp/libibmad-1.3.7/src/sa.c	Wed Feb 16 02:12:53 2011
       
   242 +++ libibmad-1.3.7/src/sa.c	Thu Oct  4 23:29:02 2012
       
   243 @@ -38,6 +38,7 @@
       
   244  #include <stdio.h>
       
   245  #include <stdlib.h>
       
   246  #include <string.h>
       
   247 +#include <errno.h>
       
   248  
       
   249  #include <infiniband/mad.h>
       
   250  #include "mad_internal.h"
       
   251 @@ -56,6 +57,7 @@
       
   252  
       
   253  	if (portid->lid <= 0) {
       
   254  		IBWARN("only lid routes are supported");
       
   255 +		errno = EIO;
       
   256  		return NULL;
       
   257  	}
       
   258  
   208 diff -r -u /tmp/libibmad-1.3.7/src/rpc.c libibmad-1.3.7/src/rpc.c
   259 diff -r -u /tmp/libibmad-1.3.7/src/rpc.c libibmad-1.3.7/src/rpc.c
   209 --- /tmp/libibmad-1.3.7/src/rpc.c	Wed Feb 16 02:12:53 2011
   260 --- /tmp/libibmad-1.3.7/src/rpc.c	Wed Feb 16 02:12:53 2011
   210 +++ libibmad-1.3.7/src/rpc.c	Thu Feb 24 11:27:14 2011
   261 +++ libibmad-1.3.7/src/rpc.c	Thu Feb 24 11:27:14 2011
   211 @@ -152,7 +152,7 @@
   262 @@ -152,7 +152,7 @@
   212  
   263