Bug 634 - unbound 1.5.0 on linux-lts 3.14.X - FAIL to start
unbound 1.5.0 on linux-lts 3.14.X - FAIL to start
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
1.5.0
x86_64 Linux
: P5 major
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-12-10 06:57 CET by cgm999
Modified: 2015-01-05 14:52 CET (History)
2 users (show)

See Also:


Attachments
Don't fail on setsockopt(... IP_MTU_DISCOVER, IP_PMTUDISC_OMIT..) returning EINVAL (2.29 KB, patch)
2014-12-10 11:31 CET, Remi Gacogne
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description cgm999 2014-12-10 06:57:14 CET
Description:
unbound 1.5.0 on linux-lts 3.14.25-1 - FAIL to start - due to missing IP_MTU_DISCOVER option in LTS 3.14.X (tested 3.14.25 / 3.14.26) kernel

# uname -r
3.14.25-1-lts
# uname -m
x86_64

# strace -Ff unbound
[...]
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(3, SOL_IP, IP_MTU_DISCOVER, [5], 4) = -1 EINVAL (Invalid argument)
write(2, "[1418021432] unbound[1689:0] err"..., 115[1418021432] unbound[1689:0] error: setsockopt(..., IP_MTU_DISCOVER,
IP_PMTUDISC_OMIT...) failed: Invalid argument) = 115
close(3) = 0
unbound[1689:0] fatal error: could not open ports
exit_group(1) = ?


Ideea so that it works on older kernels:
 Try to first setsockopt using the new option(IP_PMTUDISC_OMIT) then failback to using (IP_PMTUDISC_DONT).
Comment 1 Remi Gacogne 2014-12-10 10:28:26 CET
Just to confirm, I have the same issue with 1.5.1 and 3.14.26-1 (no surprise here).
Comment 2 Remi Gacogne 2014-12-10 11:31:17 CET
Created attachment 269 [details]
Don't fail on setsockopt(... IP_MTU_DISCOVER, IP_PMTUDISC_OMIT..) returning EINVAL

This quick patch prevents unbound from failing if setsockopt(... IP_MTU_DISCOVER, IP_PMTUDISC_OMIT..) returns EINVAL, trying setsockopt(... IP_MTU_DISCOVER, IP_PMTUDISC_DONT..) instead.

It solves the issue for me:
# strace -f unbound
[...]
setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(5, SOL_IP, IP_MTU_DISCOVER, [5], 4) = -1 EINVAL (Invalid argument)
setsockopt(5, SOL_IP, IP_MTU_DISCOVER, [0], 4) = 0
[...]
Comment 3 cgm999 2014-12-11 11:56:59 CET
Patch seems to work fine,

kernel 3.17.4-1-ARCH:
# strace -Ff -e setsockopt ./unbound -d

setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(3, SOL_IPV6, IPV6_V6ONLY, [1], 4) = 0
setsockopt(3, SOL_IPV6, IPV6_MTU, [1280], 4) = 0
setsockopt(4, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(4, SOL_IPV6, IPV6_V6ONLY, [1], 4) = 0
setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(5, SOL_IP, IP_MTU_DISCOVER, [5], 4) = 0
setsockopt(6, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0


kernel 3.14.26-1-lts:

# strace -Ff -e setsockopt ./unbound -d
setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(3, SOL_IPV6, IPV6_V6ONLY, [1], 4) = 0
setsockopt(3, SOL_IPV6, IPV6_MTU, [1280], 4) = 0
setsockopt(4, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(4, SOL_IPV6, IPV6_V6ONLY, [1], 4) = 0
setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(5, SOL_IP, IP_MTU_DISCOVER, [5], 4) = -1 EINVAL (Invalid argument)
setsockopt(5, SOL_IP, IP_MTU_DISCOVER, [0], 4) = 0
setsockopt(6, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
Comment 4 Wouter Wijngaards 2015-01-05 14:52:43 CET
Hi cmg999,

Thank you for the report and patch.  I have applied the patch, but changed the int action declaration so that the int action's do not shadow one another and give compiler warnings (on some systems).

Best regards,
   Wouter