udp: No data will be carried along w/ connect
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 16 Jun 2014 13:05:38 +0000 (21:05 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 16 Jun 2014 13:05:38 +0000 (21:05 +0800)
Pull the assertion into earlier place.

sys/netinet/udp_usrreq.c

index 55d9ce8..a182b87 100644 (file)
@@ -1226,6 +1226,7 @@ udp_connect(netmsg_t msg)
        int error;
 
        KKASSERT(&curthread->td_msgport == netisr_cpuport(0));
+       KKASSERT(msg->connect.nm_m == NULL);
 
        inp = so->so_pcb;
        if (inp == NULL) {
@@ -1305,7 +1306,6 @@ udp_connect(netmsg_t msg)
        KKASSERT(port == &curthread->td_msgport);
        error = udp_connect_oncpu(so, td, sin, if_sin);
 out:
-       KKASSERT(msg->connect.nm_m == NULL);
        lwkt_replymsg(&msg->connect.base.lmsg, error);
 }