X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=net.c;h=60f8e9a1d07cceafa4dcc51bb64ec5ae6b50b82e;hp=b2c9c43a81ad356ec021373c12d5c764fa5b76f4;hb=d27b31524e1d60ad4fdbeb606bba31ba0ee54048;hpb=97727c2e95cce064e03f495e97119cae447397d7 diff --git a/net.c b/net.c index b2c9c43a..60f8e9a1 100644 --- a/net.c +++ b/net.c @@ -157,9 +157,13 @@ int makesock(unsigned l3type, unsigned l4type, int passive, /* Set up address hint structure */ memset(&hints, 0, sizeof(hints)); hints.ai_family = l3type; - /* getaddrinfo does not really work well with SOCK_DCCP */ - if (socktype == SOCK_DGRAM || socktype == SOCK_STREAM) - hints.ai_socktype = socktype; + hints.ai_socktype = socktype; + /* + * getaddrinfo does not support SOCK_DCCP, so for the sake of lookup + * (and only then) pretend to be UDP. + */ + if (l4type == IPPROTO_DCCP) + hints.ai_socktype = SOCK_DGRAM; /* only use addresses available on the host */ hints.ai_flags = AI_ADDRCONFIG;