Created
May 10, 2015 18:31
-
-
Save vladimir-vg/ca3116a01d7013cc4e8c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if defined(IP_TOS) && defined(SOL_IP) && defined(SO_PRIORITY) | |
static int setopt_prio_tos_trick | |
(int fd, int proto, int type, char* arg_ptr, int arg_sz, int propagate) | |
{ | |
/* The relations between SO_PRIORITY, TOS and other options | |
is not what you (or at least I) would expect...: | |
If TOS is set after priority, priority is zeroed. | |
If any other option is set after tos, tos might be zeroed. | |
Therefore, save tos and priority. If something else is set, | |
restore both after setting, if tos is set, restore only | |
prio and if prio is set restore none... All to keep the | |
user feeling socket options are independent. /PaN */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment