+ if (st->use_proxy) {
+ /* Check that the packet came from our poxy server;
+ we shouldn't be contacted directly by anybody else
+ (since they can trivially forge source addresses) */
+ if (memcmp(&from.sin_addr,&st->proxy.sin_addr,4)!=0 ||
+ memcmp(&from.sin_port,&st->proxy.sin_port,2)!=0) {
+ Message(M_INFO,"udp: received packet that's not "
+ "from the proxy\n");
+ BUF_FREE(st->rbuf);
+ continue;
+ }
+ memcpy(&from.sin_addr,buf_unprepend(st->rbuf,4),4);
+ buf_unprepend(st->rbuf,2);
+ memcpy(&from.sin_port,buf_unprepend(st->rbuf,2),2);
+ }
+ struct comm_addr ca;
+ FILLZERO(ca);
+ ca.comm=&st->ops;
+ ca.sin=from;