X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=polypath.c;h=9d5c1b9990e80ad4c58b3294584dfad57c01ca85;hb=3fee817d723bfeeeacebe9567263f6d20885944a;hp=48d06a1308ef3924771285163c45922678a3c666;hpb=aa11e095dac35c4914bcd4965ff4ee03b2a154b7;p=secnet.git diff --git a/polypath.c b/polypath.c index 48d06a1..9d5c1b9 100644 --- a/polypath.c +++ b/polypath.c @@ -336,21 +336,23 @@ static void polypath_record_ifaddr(struct polypath *st, bool_t ok=polypath_make_socket(st,bad,badctx, us,ifname); if (!ok) goto out; } else { - FILLZERO(us->experienced); - us->fd=fd; + bool_t ok=udp_import_socket(uc,us,M_WARNING,fd); + if (!ok) goto out; fd=-1; } interf->socks.n_socks++; + lg_perror(LG,M_INFO,0,"using %s %s",ifname, + iaddr_to_string(&us->addr)); us=0; /* do not destroy this socket during `out' */ - lg_perror(LG,M_INFO,0,"using %s %s",ifname,ifaddr); } else { int i; for (i=0; isocks.n_socks; i++) - if (!memcmp(&interf->socks.socks[i].addr,ia,sizeof(*ia))) + if (iaddr_equal(&interf->socks.socks[i].addr,ia,True)) goto address_remove_found; BAD("address to remove not found"); address_remove_found: - lg_perror(LG,M_INFO,0,"removed %s %s",ifname,ifaddr); + lg_perror(LG,M_INFO,0,"removed %s %s",ifname, + iaddr_to_string(&interf->socks.socks[i].addr)); udp_destroy_socket(&st->uc,&interf->socks.socks[i]); interf->socks.socks[i]= interf->socks.socks[--interf->socks.n_socks];