Bug 1035977
| Summary: | with IPv6 link-local address parse err: invalid character "%" | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | JianHong Yin <jiyin> | ||||
| Component: | autofs | Assignee: | Ian Kent <ikent> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Filesystem QE <fs-qe> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 7.0 | CC: | jiyin | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | |||||||
| : | 1036032 1036033 (view as bug list) | Environment: | |||||
| Last Closed: | 2014-06-13 10:18:30 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Bug Depends On: | |||||||
| Bug Blocks: | 1036032, 1036033 | ||||||
| Attachments: |
|
||||||
|
Description
JianHong Yin
2013-11-29 05:44:09 UTC
I don't see anything in /CoreOS/autofs/Regression/bz753964 to deal with ipv6 link local addresses. I don't think that test can work with link local addresses. It's true that there is a bug in autofs where it will choke on correctly specified link local addresses but you haven't provided one. Created attachment 830809 [details] Patch - fix ipv6 link local address handling This patch will stop autofs from choking on valid ipv6 link local addresses. It will replace the name lookup error with messages like: create_client: connect() failed: Invalid argument which is essentially accurate since the address is invalid. Once autofs gets to probing using the UDP protocol the address will work without specifying an interface but mount.nfs will choke on it because it's a link local address without and interface. You'll then see: >> mount.nfs: an incorrect mount option was specified and the resulting mount failure. I can commit this and build a package if you'd like. Of course you'll need to change the test to specify the interface to use when you see a link local prefix (ie."fe80::") and you'll need to use a fixed nfs-utils package (like to one I sent to you) to test it since the mount will hang otherwise. (In reply to Ian Kent from comment #4) > I can commit this and build a package if you'd like. > > Of course you'll need to change the test to specify the interface > to use when you see a link local prefix (ie."fe80::") and you'll > need to use a fixed nfs-utils package (like to one I sent to you) > to test it since the mount will hang otherwise. The reason I haven't committed this is because I wanted feedback on my comments relating to IPv6 link local handling. Comments please? (In reply to Ian Kent from comment #5) > (In reply to Ian Kent from comment #4) > > I can commit this and build a package if you'd like. > > > > Of course you'll need to change the test to specify the interface > > to use when you see a link local prefix (ie."fe80::") and you'll > > need to use a fixed nfs-utils package (like to one I sent to you) > > to test it since the mount will hang otherwise. > > The reason I haven't committed this is because I wanted > feedback on my comments relating to IPv6 link local handling. > > Comments please? Hi Ian sorry for the late. got it and please commit that, I will test. (In reply to Yin.JianHong from comment #6) > (In reply to Ian Kent from comment #5) > > (In reply to Ian Kent from comment #4) > > > I can commit this and build a package if you'd like. > > > > > > Of course you'll need to change the test to specify the interface > > > to use when you see a link local prefix (ie."fe80::") and you'll > > > need to use a fixed nfs-utils package (like to one I sent to you) > > > to test it since the mount will hang otherwise. > > > > The reason I haven't committed this is because I wanted > > feedback on my comments relating to IPv6 link local handling. > > > > Comments please? > Hi Ian > > sorry for the late. got it and please commit that, I will test. Please remember that IPv6 link local addresses mostly require an interface to be specified, ie. <IPv6 link local address>%<interfcae>, particularly when using a connection oriented protocol like TCP. (In reply to Ian Kent from comment #7) > (In reply to Yin.JianHong from comment #6) > > (In reply to Ian Kent from comment #5) > > > (In reply to Ian Kent from comment #4) > > > > I can commit this and build a package if you'd like. > > > > > > > > Of course you'll need to change the test to specify the interface > > > > to use when you see a link local prefix (ie."fe80::") and you'll > > > > need to use a fixed nfs-utils package (like to one I sent to you) > > > > to test it since the mount will hang otherwise. > > > > > > The reason I haven't committed this is because I wanted > > > feedback on my comments relating to IPv6 link local handling. > > > > > > Comments please? > > Hi Ian > > > > sorry for the late. got it and please commit that, I will test. > > Please remember that IPv6 link local addresses mostly require an > interface to be specified, ie. <IPv6 link local address>%<interfcae>, > particularly when using a connection oriented protocol like TCP. yes I know, there is getDefaultIp() in my toolbox; [root@dhcp-13-194 ~]# getDefaultIp 6nfs fe80::a00:27ff:fe05:8ed4%eth0 --------------------------------------- getIp() { local ret local nic=$1 local ver=$2 local sc=${3} local ipaddr=`ip addr show $nic`; [ -z "$sc" ] && { sc=global; echo "$ipaddr"|grep -q 'inet6.*global' || sc=link; } local flg='(global|host lo)' case $ver in 6|6nfs) ret=`echo "$ipaddr" | awk '/inet6.*'$sc'/{match($0,"inet6 ([0-9a-f:]+)",M); print M[1]}'` [ -n "$ret" -a $ver = 6nfs ] && ret=$ret%$nic;; 4|*) ret=`echo "$ipaddr" | awk '/inet .*'"$flg"'/{match($0,"inet ([0-9.]+)",M); print M[1]}'`;; esac echo "$ret" [ -z "$ret" ] && return 1 || return 0 } getDefaultNic() { ip route | awk '/default/{match($0,"dev ([^ ]+)",M); print M[1]}' } getDefaultIp() { local nic=`getDefaultNic` [ -z "$nic" ] && return 1 getIp "$nic" "$@" } Hi Ian: before patched: [00:17:04 root@ /mnt/tests/CoreOS/autofs/Regression/bz753964]# cat /var/log/messages Dec 3 00:17:04 hp-sl390s-01 automount[11355]: handle_packet: type = 3 Dec 3 00:17:04 hp-sl390s-01 automount[11355]: handle_packet_missing_indirect: token 3, name scratchv6l, request pid 13946 Dec 3 00:17:04 hp-sl390s-01 automount[11355]: attempting to mount entry /mnt/bz753964/scratchv6l Dec 3 00:17:04 hp-sl390s-01 automount[11355]: lookup_mount: lookup(file): looking up scratchv6l Dec 3 00:17:04 hp-sl390s-01 automount[11355]: lookup_mount: lookup(file): scratchv6l -> -fstype=nfs4 [fe80::0:1040:214:5eff:fe5b:8faa%enp57s2]:/exports/home Dec 3 00:17:04 hp-sl390s-01 automount[11355]: parse_mount: parse(sun): expanded entry: -fstype=nfs4 [fe80::0:1040:214:5eff:fe5b:8faa%enp57s2]:/exports/home Dec 3 00:17:04 hp-sl390s-01 automount[11355]: parse_mount: parse(sun): gathered options: fstype=nfs4 Dec 3 00:17:04 hp-sl390s-01 automount[11355]: validate_location: invalid character "%" found in location [fe80::0:1040:214:5eff:fe5b:8faa%enp57s2]:/exports/home Dec 3 00:17:04 hp-sl390s-01 automount[11355]: dev_ioctl_send_fail: token = 3 Dec 3 00:17:04 hp-sl390s-01 automount[11355]: failed to mount /mnt/bz753964/scratchv6l after patch: [00:12:50 root@ /mnt/tests/CoreOS/autofs/Regression/bz753964]# cat /var/log/messages Dec 3 00:12:46 hp-dl385pg8-03 automount[11051]: handle_packet: type = 3 Dec 3 00:12:46 hp-dl385pg8-03 automount[11051]: handle_packet_missing_indirect: token 3, name scratchv6l, request pid 13634 Dec 3 00:12:46 hp-dl385pg8-03 automount[11051]: attempting to mount entry /mnt/bz753964/scratchv6l Dec 3 00:12:46 hp-dl385pg8-03 automount[11051]: lookup_mount: lookup(file): looking up scratchv6l Dec 3 00:12:46 hp-dl385pg8-03 automount[11051]: lookup_mount: lookup(file): scratchv6l -> -fstype=nfs4 [fe80::0:4257:213:20ff:fefb:4d96%em1]:/exports/home Dec 3 00:12:46 hp-dl385pg8-03 automount[11051]: parse_mount: parse(sun): expanded entry: -fstype=nfs4 [fe80::0:4257:213:20ff:fefb:4d96%em1]:/exports/home Dec 3 00:12:46 hp-dl385pg8-03 automount[11051]: parse_mount: parse(sun): gathered options: fstype=nfs4 Dec 3 00:12:46 hp-dl385pg8-03 automount[11051]: parse_mount: parse(sun): dequote("[fe80::0:4257:213:20ff:fefb:4d96%em1]:/exports/home") -> [fe80::0:4257:213:20ff:fefb:4d96%em1]:/exports/home Dec 3 00:12:46 hp-dl385pg8-03 automount[11051]: parse_mount: parse(sun): core of entry: options=fstype=nfs4, loc=[fe80::0:4257:213:20ff:fefb:4d96%em1]:/exports/home Dec 3 00:12:46 hp-dl385pg8-03 automount[11051]: sun_mount: parse(sun): mounting root /mnt/bz753964, mountpoint scratchv6l, what [fe80::0:4257:213:20ff:fefb:4d96%em1]:/exports/home, fstype nfs4, options Dec 3 00:12:46 hp-dl385pg8-03 automount[11051]: mount_mount: mount(nfs): root=/mnt/bz753964 name=scratchv6l what=[fe80::0:4257:213:20ff:fefb:4d96%em1]:/exports/home, fstype=nfs4, options= Dec 3 00:12:46 hp-dl385pg8-03 automount[11051]: mount_mount: mount(nfs): nfs options="", nobind=0, nosymlink=0, ro=0 Dec 3 00:12:46 hp-dl385pg8-03 automount[11051]: get_nfs_info: called with host [fe80::0:4257:213:20ff:fefb:4d96%em1](fe80::4257:213:20ff:fefb:4d96) proto 6 version 0x40 Dec 3 00:12:49 hp-dl385pg8-03 automount[11051]: mount(nfs): no hosts available Dec 3 00:12:49 hp-dl385pg8-03 automount[11051]: dev_ioctl_send_fail: token = 3 Dec 3 00:12:49 hp-dl385pg8-03 automount[11051]: failed to mount /mnt/bz753964/scratchv6l What does this do?
run 'ServerIPv6nfs=`ssh ${SERVER} getDefaultIp 6nfs`'
(In reply to Ian Kent from comment #11) > What does this do? > run 'ServerIPv6nfs=`ssh ${SERVER} getDefaultIp 6nfs`' 1. this is a multihost test, get the server's ipv6 address: the getDefaultIp commands get the Ip address of the default NIC; getDefaultIp 6 #get the <ipv6 address> getDefaultIp 6nfs #get the <ipv6 address>%<NIC> format for nfs. 2. now in this test case, I forge a local fe80:: address, for test the local ipv6 and I just grep the 'automount[]: mount_mount: mount(nfs): ' if match test OK: run '>/var/log/messages' - run 'timeLimitRun 180 ls -l /mnt/${TESTNAME}/scratchv6l' - run 'cat /var/log/messages | grep "automount\[[0-9]\+\]: *mount_mount: *mount(nfs):"' [ $? != 0 ] && run 'cat /var/log/messages' - (In reply to Yin.JianHong from comment #12) > (In reply to Ian Kent from comment #11) > > What does this do? > > run 'ServerIPv6nfs=`ssh ${SERVER} getDefaultIp 6nfs`' > > 1. this is a multihost test, get the server's ipv6 address: > the getDefaultIp commands get the Ip address of the default NIC; > getDefaultIp 6 #get the <ipv6 address> > getDefaultIp 6nfs #get the <ipv6 address>%<NIC> format for nfs. I don't see how this can get the nic on the client which needs to be used to send out the request. The nic might be the same on the client as it is on the server but that's often not the case for checked out machines. IIUC link local addresses must be usable in the absence of a router on the network, hence the target (server) address and the source (client) interface, the where to send the packets, must be supplied. The machines I checked out to test this certainly didn't have the same interface names and it worked for me. I'm checking out two machines again to make sure. (In reply to Ian Kent from comment #13) > (In reply to Yin.JianHong from comment #12) > > (In reply to Ian Kent from comment #11) > > > What does this do? > > > run 'ServerIPv6nfs=`ssh ${SERVER} getDefaultIp 6nfs`' > > > > 1. this is a multihost test, get the server's ipv6 address: > > the getDefaultIp commands get the Ip address of the default NIC; > > getDefaultIp 6 #get the <ipv6 address> > > getDefaultIp 6nfs #get the <ipv6 address>%<NIC> format for nfs. > > I don't see how this can get the nic on the client which needs > to be used to send out the request. > > The nic might be the same on the client as it is on the server > but that's often not the case for checked out machines. > > IIUC link local addresses must be usable in the absence of a > router on the network, hence the target (server) address and > the source (client) interface, the where to send the packets, > must be supplied. I think I've lead you astray here a bit. I'm not certain about this link local stuff but ... Using the link local address is probably not useful at all for testing since we often get hosts that are on a different subnets so the link local addresses can't work (they aren't routed). I think it's more sensible to select the address of the default interface that's marked as global to get IPv6 testing to function reliably. > > The machines I checked out to test this certainly didn't have > the same interface names and it worked for me. I'm checking out > two machines again to make sure. The two machines I just checked out were on different subnets so I couldn't even ping6 one to the other. Using the IPv6 address marked global worked fine for ping6 and automounting with revision 37 worked fine, and would probably work with 35 too since it doesn't require an interface to be given. I think the patch here should remain for people that do want to use link local addresses but as for out testing I'm not sure what to do. Ian (In reply to Ian Kent from comment #14) > (In reply to Ian Kent from comment #13) > > (In reply to Yin.JianHong from comment #12) > > > (In reply to Ian Kent from comment #11) > > > > What does this do? > > > > run 'ServerIPv6nfs=`ssh ${SERVER} getDefaultIp 6nfs`' > > > > > > 1. this is a multihost test, get the server's ipv6 address: > > > the getDefaultIp commands get the Ip address of the default NIC; > > > getDefaultIp 6 #get the <ipv6 address> > > > getDefaultIp 6nfs #get the <ipv6 address>%<NIC> format for nfs. > > > > I don't see how this can get the nic on the client which needs > > to be used to send out the request. > > > > The nic might be the same on the client as it is on the server > > but that's often not the case for checked out machines. > > > > IIUC link local addresses must be usable in the absence of a > > router on the network, hence the target (server) address and > > the source (client) interface, the where to send the packets, > > must be supplied. > > I think I've lead you astray here a bit. > > I'm not certain about this link local stuff but ... > > Using the link local address is probably not useful at all for > testing since we often get hosts that are on a different subnets > so the link local addresses can't work (they aren't routed). > > I think it's more sensible to select the address of the default > interface that's marked as global to get IPv6 testing to function > reliably. > > > > > The machines I checked out to test this certainly didn't have > > the same interface names and it worked for me. I'm checking out > > two machines again to make sure. > > The two machines I just checked out were on different subnets so > I couldn't even ping6 one to the other. > > Using the IPv6 address marked global worked fine for ping6 and > automounting with revision 37 worked fine, and would probably > work with 35 too since it doesn't require an interface to be > given. > > I think the patch here should remain for people that do want to > use link local addresses but as for out testing I'm not sure what > to do. > > Ian Got it, I will learn some knowledge about IPv6 local link by google. getDefaultIp has the third argument, I will use it to confirm the test condition $(getDefaultIp 6 global) #this mount ok $(getDefaultIp 6nfs link) #this just check the messages see if get root= name= what= OK. right? (In reply to Yin.JianHong from comment #15) > (In reply to Ian Kent from comment #14) > > (In reply to Ian Kent from comment #13) > > > (In reply to Yin.JianHong from comment #12) > > > > (In reply to Ian Kent from comment #11) > > > > > What does this do? > > > > > run 'ServerIPv6nfs=`ssh ${SERVER} getDefaultIp 6nfs`' > > > > > > > > 1. this is a multihost test, get the server's ipv6 address: > > > > the getDefaultIp commands get the Ip address of the default NIC; > > > > getDefaultIp 6 #get the <ipv6 address> > > > > getDefaultIp 6nfs #get the <ipv6 address>%<NIC> format for nfs. > > > > > > I don't see how this can get the nic on the client which needs > > > to be used to send out the request. > > > > > > The nic might be the same on the client as it is on the server > > > but that's often not the case for checked out machines. > > > > > > IIUC link local addresses must be usable in the absence of a > > > router on the network, hence the target (server) address and > > > the source (client) interface, the where to send the packets, > > > must be supplied. > > > > I think I've lead you astray here a bit. > > > > I'm not certain about this link local stuff but ... > > > > Using the link local address is probably not useful at all for > > testing since we often get hosts that are on a different subnets > > so the link local addresses can't work (they aren't routed). > > > > I think it's more sensible to select the address of the default > > interface that's marked as global to get IPv6 testing to function > > reliably. > > > > > > > > The machines I checked out to test this certainly didn't have > > > the same interface names and it worked for me. I'm checking out > > > two machines again to make sure. > > > > The two machines I just checked out were on different subnets so > > I couldn't even ping6 one to the other. > > > > Using the IPv6 address marked global worked fine for ping6 and > > automounting with revision 37 worked fine, and would probably > > work with 35 too since it doesn't require an interface to be > > given. > > > > I think the patch here should remain for people that do want to > > use link local addresses but as for out testing I'm not sure what > > to do. > > > > Ian > > Got it, I will learn some knowledge about IPv6 local link by google. > > getDefaultIp has the third argument, I will use it to confirm the test > condition > $(getDefaultIp 6 global) #this mount ok > $(getDefaultIp 6nfs link) #this just check the messages > see if get root= name= what= OK. > right? Not quite. automount will not be able to probe availability of these when they aren't reachable so you should get the "no hosts available" message and no mount attempt. That's what the probe is for, to prevent long waits for mount attempts to timeout. Ian > > Got it, I will learn some knowledge about IPv6 local link by google. > > > > getDefaultIp has the third argument, I will use it to confirm the test > > condition > > $(getDefaultIp 6 global) #this mount ok > > $(getDefaultIp 6nfs link) #this just check the messages > > see if get root= name= what= OK. > > right? > > Not quite. > > automount will not be able to probe availability of these when > they aren't reachable so you should get the "no hosts available" > message and no mount attempt. > > That's what the probe is for, to prevent long waits for mount > attempts to timeout. yes I see. I have added condition for the test, to ensure the addr available [ -n "$ServerIPv6g" ] && { run '>/var/log/messages' - run 'timeLimitRun 180 ls -l /mnt/${TESTNAME}/scratchv6g' - ...judge } [ -n "$ServerIPv6l" ] && { run '>/var/log/messages' - run 'timeLimitRun 180 ls -l /mnt/${TESTNAME}/scratchv6l' - ...judge } > > Ian verified in autofs-5.0.7-37.el7 at 'RHBA-2013:16105' https://beaker.engineering.redhat.com/jobs/555498 This request was resolved in Red Hat Enterprise Linux 7.0. Contact your manager or support representative in case you have further questions about the request. |