chiark / gitweb /
udp: Insist on only one successful default socket setup
[secnet.git] / polypath.c
index 9d5c1b9990e80ad4c58b3294584dfad57c01ca85..abbda21c4afcaf5d2bdcade49798fd75f345d196 100644 (file)
@@ -321,8 +321,8 @@ static void polypath_record_ifaddr(struct polypath *st,
     interf->socks.n_socks=0;
     FILLZERO(interf->experienced_xmit_noaf);
     LIST_INSERT_HEAD(&st->interfs,interf,entry);
-    udp_socks_register(&st->uc,&interf->socks);
     interf->name=strdup(ifname);
+    udp_socks_register(&st->uc,&interf->socks,interf->name);
     if (!interf->name) BADE("strdup interface name",errno);
  found_interf:
 
@@ -439,8 +439,8 @@ static bool_t polypath_sendmsg(void *commst, struct buffer_if *buf,
            attempted=True;
            int r=sendto(us->fd,buf->start,buf->size,
                         0,&dest->ia.sa,iaddr_socklen(&dest->ia));
-           udp_sock_experienced(0,&st->uc, interf->name,us,
-                                1,af, r,errno);
+           udp_sock_experienced(0,&st->uc,&interf->socks,us,
+                                &dest->ia,af, r,errno);
            if (r>=0) {
                reasonable=True;
                break;