ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/slirp/udp.c
(Generate patch)

Comparing BasiliskII/src/slirp/udp.c (file contents):
Revision 1.4 by gbeauche, 2006-03-25T07:57:38Z vs.
Revision 1.8 by asvitkine, 2012-03-30T01:10:28Z

# Line 10 | Line 10
10   * 2. Redistributions in binary form must reproduce the above copyright
11   *    notice, this list of conditions and the following disclaimer in the
12   *    documentation and/or other materials provided with the distribution.
13 < * 3. All advertising materials mentioning features or use of this software
14 < *    must display the following acknowledgement:
15 < *      This product includes software developed by the University of
16 < *      California, Berkeley and its contributors.
17 < * 4. Neither the name of the University nor the names of its contributors
13 > * 3. Neither the name of the University nor the names of its contributors
14   *    may be used to endorse or promote products derived from this software
15   *    without specific prior written permission.
16   *
# Line 42 | Line 38
38   * terms and conditions of the copyright.
39   */
40  
41 + #include <stdlib.h>
42   #include <slirp.h>
43   #include "ip_icmp.h"
44  
# Line 205 | Line 202 | udp_input(m, iphlen)
202            /* udp_last_so = so; */
203            so->so_laddr = ip->ip_src;
204            so->so_lport = uh->uh_sport;
208          so->so_faddr = ip->ip_dst; /* XXX */
209          so->so_fport = uh->uh_dport; /* XXX */
205            
206            if ((so->so_iptos = udp_tos(so)) == 0)
207              so->so_iptos = ip->ip_tos;
# Line 217 | Line 212 | udp_input(m, iphlen)
212             */
213          }
214  
215 +        so->so_faddr = ip->ip_dst; /* XXX */
216 +        so->so_fport = uh->uh_dport; /* XXX */
217 +
218          iphlen += sizeof(struct udphdr);
219          m->m_len -= iphlen;
220          m->m_data += iphlen;
# Line 312 | Line 310 | int udp_output(struct socket *so, struct
310      struct sockaddr_in saddr, daddr;
311  
312      saddr = *addr;
313 <    if ((so->so_faddr.s_addr & htonl(0xffffff00)) == special_addr.s_addr)
313 >    if ((so->so_faddr.s_addr & htonl(0xffffff00)) == special_addr.s_addr) {
314          saddr.sin_addr.s_addr = so->so_faddr.s_addr;
315 +        if ((so->so_faddr.s_addr & htonl(0x000000ff)) == htonl(0xff))
316 +            saddr.sin_addr.s_addr = alias_addr.s_addr;
317 +    }
318      daddr.sin_addr = so->so_laddr;
319      daddr.sin_port = so->so_lport;
320      
# Line 658 | Line 659 | udp_listen(port, laddr, lport, flags)
659          getsockname(so->s,(struct sockaddr *)&addr,&addrlen);
660          so->so_fport = addr.sin_port;
661          if (addr.sin_addr.s_addr == 0 || addr.sin_addr.s_addr == loopback_addr.s_addr)
662 <           so->so_faddr = our_addr;
662 >           so->so_faddr = alias_addr;
663          else
664             so->so_faddr = addr.sin_addr;
665          

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines