From: Fredrik Tolf Date: Fri, 17 Oct 2008 23:11:09 +0000 (+0200) Subject: Merge branch 'master' into socket X-Git-Tag: 1.3~11^2 X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=51da262d8d796aa8a31ee1513783735a40130931;p=doldaconnect.git Merge branch 'master' into socket Conflicts: daemon/net.c --- 51da262d8d796aa8a31ee1513783735a40130931 diff --cc daemon/net.c index d64e8c8,d0cd9c8..240855a --- a/daemon/net.c +++ b/daemon/net.c @@@ -1154,17 -985,13 +1158,19 @@@ static struct ufd *getskufd(struct sock int socksettos(struct socket *sk, int tos) { int buf; + struct ufd *ufd; + int dscp2tos; - if(sk->family == AF_UNIX) + ufd = getskufd(sk); + if(ufd->type != UFD_SOCK) { + errno = EOPNOTSUPP; + return(-1); + } + if(ufd->d.s.family == AF_UNIX) return(0); /* Unix sockets are always perfect. :) */ - if(sk->family == AF_INET) + if(ufd->d.s.family == AF_INET) { + dscp2tos = confgetint("net", "dscp-tos"); switch(tos) { case 0: