patch-main_c 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- udp-broadcast-relay-0.3.orig/main.c 2003-09-28 16:43:32.000000000 +0200
  3. +++ udp-broadcast-relay-0.3/main.c 2008-10-15 16:04:02.000000000 +0200
  4. @@ -220,8 +220,8 @@ main(int argc,char **argv)
  5. }
  6. /* Save the address for later use */
  7. - bcopy( (struct sockaddr_in *)&reqbuf.ifr_addr,
  8. - &ifs[maxifs].dstaddr,
  9. + memcpy( &ifs[maxifs].dstaddr,
  10. + (struct sockaddr_in *)&reqbuf.ifr_addr,
  11. sizeof(struct sockaddr_in) );
  12. DPRINT("%s: %i / %s\n",
  13. @@ -349,7 +349,7 @@ main(int argc,char **argv)
  14. DPRINT("From:\t\t%s:%d\n",inet_ntoa(rcv_addr.sin_addr),rcv_addr.sin_port);
  15. /* copy sender's details into our datagram as the source addr */
  16. - bcopy(&(rcv_addr.sin_addr.s_addr),(gram+12),4);
  17. + memcpy((gram+12),&(rcv_addr.sin_addr.s_addr),4);
  18. *(u_short*)(gram+20)=(u_short)rcv_addr.sin_port;
  19. /* set the length of the packet */
  20. @@ -362,7 +362,7 @@ main(int argc,char **argv)
  21. if (ifs[x].ifindex == rcv_ifindex) continue; /* no bounces, please */
  22. /* Set destination addr ip - port is set already*/
  23. - bcopy(&(ifs[x].dstaddr.sin_addr.s_addr),(gram+16),4);
  24. + memcpy((gram+16),&(ifs[x].dstaddr.sin_addr.s_addr),4);
  25. DPRINT ("Sent to %s:%d on interface %i\n",
  26. inet_ntoa(ifs[x].dstaddr.sin_addr), /* dst ip */