-
Notifications
You must be signed in to change notification settings - Fork 201
sockopt: add IP_DONTFRAG/IP_MTU_DISCOVER option #603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e752584 to
714e97b
Compare
|
Like |
714e97b to
beaba43
Compare
macOS doesn't set DF-bit by default thus we need an interface to configure the flag. Signed-off-by: Hajime Tazaki <[email protected]>
beaba43 to
086ca1b
Compare
thanks, I've tried to implement it in the updated patches. pls take a lookt at it. |
| setDontFragment s = when (family == AF_INET) $ | ||
| #if HAVE_DECL_IP_DONTFRAG || HAVE_DECL_IP_MTU_DISCOVER | ||
| setSocketOption s DontFragment 1 | ||
| #else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These four lines (#else clause) are not necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there are OSs/kernels which don't have those sockoption, I guess the compilation fails like below.
Network/Socket/Syscall.hs:138:1: error: [GHC-58481]
parse error (possibly incorrect indentation or mismatched brackets)
|
138 | bind :: SocketAddress sa => Socket -> sa -> IO ()
| ^
I followed the way ipv6only option does in the #else clause to work around this situation.
do you still think it's unnecessary ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind.
I misunderstand that you are using setDontFragment here but you are defining it here.
kazu-yamamoto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
|
Merged. |
macOS doesn't set DF-bit by default thus we need an interface to configure the flag.