[go: nahoru, domu]

Skip to content

Commit

Permalink
Merge pull request h2o#2489 from h2o/kazuho/failure-to-set-DONTFRAG-i…
Browse files Browse the repository at this point in the history
…s-not-fatal

[http3] fix startup failure when OS does not provide support for IP_DONTFRAG
  • Loading branch information
kazuho committed Nov 17, 2020
2 parents 8a5be4f + 55cb50a commit 5223c33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/common/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ int h2o_socket_set_df_bit(int fd, int domain)
do { \
int optvar = _optvar; \
if (setsockopt(fd, ip, optname, &optvar, sizeof(optvar)) != 0) { \
perror("setsockopt(" H2O_TO_STR(optname) ")"); \
perror("failed to set the DF bit through setsockopt(" H2O_TO_STR(ip) ", " H2O_TO_STR(optname) ")"); \
return 0; \
} \
return 1; \
Expand Down
7 changes: 3 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1215,12 +1215,11 @@ static int open_listener(int domain, int type, int protocol, struct sockaddr *ad
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) != 0)
goto Error;
} break;
case SOCK_DGRAM: {
case SOCK_DGRAM:
/* UDP: set SO_REUSEPORT and DF bit */
socket_reuseport(fd);
if (!h2o_socket_set_df_bit(fd, domain))
goto Error;
} break;
h2o_socket_set_df_bit(fd, domain);
break;
default:
h2o_fatal("unexpected socket type %d", type);
break;
Expand Down

0 comments on commit 5223c33

Please sign in to comment.