Linux CIFS IPv6 Patch

David Holder david.holder at
Wed Jun 13 10:01:12 GMT 2007

I have been testing the IPv6 enabled version of the Linux CIFS client
against Windows Server 2008 (formally Longhorn). It was working fine on our
IPv6 test network. It stopped working when I tried it on the live Erion


The error message was 'ip address too long'. Our test lab uses very short
IPv6 addresses, like 3000::1. Our real network uses full addresses. 


I found that the test for the length of the IP address was two short in
mount.cifs and in fs/cifs/connect.c. The test was for 35 bytes. I have
changed this to 45 bytes. I also changed some error checking in connect.c.
This change is not necessary for this fix to work (I duplicated the code so
it probably isn't the best way to do it).


The longest possible IPv6 address is an IPv4-mapped IPv6 address written in
full. For example:




This is 45 bytes long. I suspect that the 35 in the current code is a typo.


Two patches are attached. One for mount.cifs.c and one for connect.c. The
versions I was working with were linux-2.6.21 patched with 2.6.22-rc2 and


Any questions let me know. Also, what is the best way of submitting patches
for the Linux CIFS client - is this OK?





Dr David Holder CEng MIET MIEEE

Erion Ltd, Oakleigh, Upper Sutherland Road, Halifax, HX3 8NT

Reception: +44 (0)1422 207000

Direct Dial: +44 (0)131 2026317

Cell: +44 (0) 7768 456831


Registered in England and Wales. Registered Number 3521142

VAT Number: GB 698 3633 78


-------------- next part --------------
A non-text attachment was scrubbed...
Name: mount.cifs-3.0.24.diff
Type: application/octet-stream
Size: 198 bytes
Desc: not available
Url :
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cifs-2.6.22-rc2.diff
Type: application/octet-stream
Size: 1110 bytes
Desc: not available
Url :

More information about the samba-technical mailing list