srp_daemon: check that port LID is valid before calling create_ah
PATCH 1/1 srp_daemon: check that port LID is valid before calling create_ah
From: Vladimir Koushnir <[email protected]>
The default LID that is given to the port is not valid (a valid LID value is > 0 and < 0xc000), so in case the port didn't get a valid lid from the SM there is no need to call create_ah.
--- srp_daemon/srp_daemon.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
srp_daemon/srp_daemon.c +3 -2
@@ -2228,8 +2228,9 @@ catas_start:pr_debug ("Starting a recalculation\n" ); port_lid =get_port_lid (res->ud_res->ib_ctx, config->port_num, &sm_lid); -if (port_lid != res->ud_res->port_attr.lid || - sm_lid != res->ud_res->port_attr.sm_lid) { +if (port_lid >0 && port_lid <0xc000 && + (port_lid != res->ud_res->port_attr.lid || + sm_lid != res->ud_res->port_attr.sm_lid)) {if (res->ud_res->ah) {ibv_destroy_ah (res->ud_res->ah);
Signature · 1 line
2.17.2
Quoted 19 lines · Sergey Gorenko
From: Vladimir Koushnir <[email protected]>
The default LID that is given to the port is not valid (a valid LID value is > 0 and <
0xc000), so in case the port didn't get a valid lid from the SM there is no need to callcreate_ah.Signed-off-by Vladimir Koushnir <[email protected]>Signed-off-by Sergey Gorenko <[email protected]>--- srp_daemon/srp_daemon.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)srp_daemon/srp_daemon.c +0
-0@@ -2228,8 +2228,9 @@ catas_start:pr_debug ("Starting a recalculation\n" );
srp_daemon/srp_daemon.c catas_start: · line 2236
Quoted 10 lines
srp_daemon/srp_daemon.c +3
-2port_lid =get_port_lid (res->ud_res->ib_ctx, config->port_num, &sm_lid); -if (port_lid != res->ud_res->port_attr.lid || - sm_lid != res->ud_res->port_attr.sm_lid) { +if (port_lid >0 && port_lid <0xc000 && + (port_lid != res->ud_res->port_attr.lid || + sm_lid != res->ud_res->port_attr.sm_lid)) {if (res->ud_res->ah) {ibv_destroy_ah (res->ud_res->ah);
Doug Ledford
AppliedQuoted 11 lines · Sergey Gorenko
From: Vladimir Koushnir <[email protected]>
The default LID that is given to the port is not valid (a valid LID value
is > 0 and <0xc000), so in case the port didn't get a valid lid from the
SM there is no need to callcreate_ah.Signed-off-by Vladimir Koushnir <[email protected]>Signed-off-by Sergey Gorenko <[email protected]>---
Thanks, applied.
Signature · 3 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD