Commit 4503a319 authored by Joe Loser's avatar Joe Loser Committed by Facebook Github Bot

Fix unused variable error in AsyncUDPSocket

Summary:
Some OSes do not define `IP_MTU_DISCOVER` or `IPV6_MTU_DISCOVER`. As such, this would result in the function argument parameter `df` being unused, which is a warning that is then treated as an error.

Earlier today (2806dda4), this logic was added about setting the DF which broke Mac builds.
Closes https://github.com/facebook/folly/pull/791

Reviewed By: igorsugak

Differential Revision: D7116863

Pulled By: yfeldblum

fbshipit-source-id: 5092891c8977a44ab58723f8cef352dd4eaa1210
parent 417d7131
......@@ -133,6 +133,7 @@ void AsyncUDPSocket::bind(const folly::SocketAddress& address) {
}
void AsyncUDPSocket::dontFragment(bool df) {
(void)df; // to avoid potential unused variable warning
#ifdef IP_MTU_DISCOVER
if (address().getFamily() == AF_INET) {
int v4 = df ? IP_PMTUDISC_DO : IP_PMTUDISC_WANT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment