open-iscsi / target-isns

Target-isns is an iSNS client for the Linux LIO iSCSI target
GNU General Public License v2.0
16 stars 19 forks source link

Can't update "Device Attr" to window 2008 iSNS server. #44

Closed wncboy closed 6 years ago

wncboy commented 6 years ago

I found an issue, a target contain multiple Portal address, if we remove a Portal address, target-isns will send a DevAttrReg to remote server, but window 2008 iSNS server return "Source Unauthorized".

The following is a log: test:~# /usr/bin/target-isns -d -f -i 10.40.3.139 0.000001 I: target-isns version 0.6.5 started 0.000037 I: iSNS server is 10.40.3.139:3205 0.001556 D: iSNS connection opened (fd = 7) 0.002183 D: registering target (all) 0.002198 D: source attribute set to iqn.1994-11.com.net:test-ted:55c60bbe:group2 0.002213 D: gen header DevAttrReg: len = 716, flags = 0x8c00, tx = 1, seq = 0 0.002239 D: sending last PDU seq 0, length 716 0.017133 D: got header DevAttrRegRsp: len = 660, flags = 0x4c00, tx = 1, seq = 0 0.017169 D: iqn.1994-11.com.net:test-ted:55c60bbe:group2 is a target 0.017191 D: iqn.1994-11.com.net:test-ted:8dcf8729:group1 is a target 6.591734 D: inotify[D] iqn.1994-11.com.net:test-ted:8dcf8729:group1/tpg1/192.168.1.22 8.591788 D: registering target iqn.1994-11.com.net:test-ted:8dcf8729:group1 8.591824 D: gen header DevAttrReg: len = 392, flags = 0x9c00, tx = 2, seq = 0 8.591834 D: sending last PDU seq 0, length 392 8.593320 D: got header DevAttrRegRsp: len = 4, flags = 0x4c00, tx = 2, seq = 0 8.593337 E: error in response (status = 8) 15.964334 D: inotify[D] iqn.1994-11.com.net:test-ted:8dcf8729:group1/tpg1/10.40.0.194 15.964589 D: inotify[C] iqn.1994-11.com.net:test-ted:8dcf8729:group1/tpg1/192.168.1.22 17.964382 D: registering target iqn.1994-11.com.net:test-ted:8dcf8729:group1 17.964418 D: gen header DevAttrReg: len = 392, flags = 0x9c00, tx = 3, seq = 0 17.964431 D: sending last PDU seq 0, length 392 17.965350 D: got header DevAttrRegRsp: len = 4, flags = 0x4c00, tx = 3, seq = 0 17.965367 E: error in response (status = 8)

I don't know why windows server will return this error code, is it a bug of target-isns?

wncboy commented 6 years ago

Replace packet is not correct, I test window 2008 iSNS and open-isns, the error code of window 2008 iSNS is 8, the error code of open-isns is 3.

cvubrugier commented 6 years ago

Thank you @wncboy for your bug report and your fix!