312 |
|
struct sockaddr_in saddr, daddr; |
313 |
|
|
314 |
|
saddr = *addr; |
315 |
< |
if ((so->so_faddr.s_addr & htonl(0xffffff00)) == special_addr.s_addr) |
315 |
> |
if ((so->so_faddr.s_addr & htonl(0xffffff00)) == special_addr.s_addr) { |
316 |
|
saddr.sin_addr.s_addr = so->so_faddr.s_addr; |
317 |
+ |
if ((so->so_faddr.s_addr & htonl(0x000000ff)) == htonl(0xff)) |
318 |
+ |
saddr.sin_addr.s_addr = alias_addr.s_addr; |
319 |
+ |
} |
320 |
|
daddr.sin_addr = so->so_laddr; |
321 |
|
daddr.sin_port = so->so_lport; |
322 |
|
|
405 |
|
struct mbuf *m; |
406 |
|
{ |
407 |
|
struct sockaddr_in addr; |
408 |
< |
int addrlen = sizeof(addr); |
408 |
> |
socklen_t addrlen = sizeof(addr); |
409 |
|
#ifdef EMULATE_TALK |
410 |
|
CTL_MSG_OLD *omsg; |
411 |
|
CTL_MSG *nmsg; |
428 |
|
uint32_t d_addr; // destination address |
429 |
|
uint16_t s_family; // source family |
430 |
|
uint16_t s_port; // source port |
431 |
< |
uint32_t s_addr; // source address |
431 |
> |
uint32_t so_addr; // source address |
432 |
|
uint32_t seqn; // sequence number |
433 |
|
uint16_t message; // message |
434 |
|
uint16_t data_type; // data type |
620 |
|
return; |
621 |
|
cu_head = mtod(m, struct cu_header *); |
622 |
|
cu_head->s_port = addr.sin_port; |
623 |
< |
cu_head->s_addr = our_addr.s_addr; |
623 |
> |
cu_head->so_addr = our_addr.s_addr; |
624 |
|
} |
625 |
|
|
626 |
|
return; |
636 |
|
{ |
637 |
|
struct sockaddr_in addr; |
638 |
|
struct socket *so; |
639 |
< |
int addrlen = sizeof(struct sockaddr_in), opt = 1; |
639 |
> |
socklen_t addrlen = sizeof(struct sockaddr_in); |
640 |
> |
int opt = 1; |
641 |
|
|
642 |
|
if ((so = socreate()) == NULL) { |
643 |
|
free(so); |
661 |
|
getsockname(so->s,(struct sockaddr *)&addr,&addrlen); |
662 |
|
so->so_fport = addr.sin_port; |
663 |
|
if (addr.sin_addr.s_addr == 0 || addr.sin_addr.s_addr == loopback_addr.s_addr) |
664 |
< |
so->so_faddr = our_addr; |
664 |
> |
so->so_faddr = alias_addr; |
665 |
|
else |
666 |
|
so->so_faddr = addr.sin_addr; |
667 |
|
|