udp: Disable direct detach only if multicast options are to be set.
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 25 Feb 2015 03:26:52 +0000 (11:26 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 25 Feb 2015 03:28:42 +0000 (11:28 +0800)
sys/netinet/udp_usrreq.c

index b588256..045e265 100644 (file)
@@ -260,7 +260,7 @@ udp_ctloutput(netmsg_t msg)
        struct sockopt *sopt = msg->ctloutput.nm_sopt;
        struct  inpcb *inp = so->so_pcb;
 
-       if (sopt->sopt_level == IPPROTO_IP) {
+       if (sopt->sopt_level == IPPROTO_IP && sopt->sopt_dir == SOPT_SET) {
                switch (sopt->sopt_name) {
                case IP_MULTICAST_IF:
                case IP_MULTICAST_VIF: