diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2013-02-04 15:10:23 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2013-02-04 15:10:23 +0000 |
commit | f3e78b4835af86686049f5d06ba01222327d25db (patch) | |
tree | fa8864ff3b08dd7f16d96fe6e71ae99ecd1c40f2 /sys | |
parent | 62acd246e4e235cb2c34b6d16e59ed9d467de457 (diff) |
Set sa_len correctly for PF_INET (and be consistent with the PF_INET6
case). On our platforms, sizeof(struct sockaddr) matches sizeof(struct
sockaddr_in) so this hasn't caused problems but it is still incorrect.
From Anthony Low. OK martynas@ bluhm@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/in_pcb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index bcda9092012..083787a9d31 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.c,v 1.129 2013/01/16 00:07:22 bluhm Exp $ */ +/* $OpenBSD: in_pcb.c,v 1.130 2013/02/04 15:10:22 millert Exp $ */ /* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */ /* @@ -775,7 +775,7 @@ in_pcbrtentry(struct inpcb *inp) if (inp->inp_faddr.s_addr == INADDR_ANY) break; ro->ro_dst.sa_family = AF_INET; - ro->ro_dst.sa_len = sizeof(ro->ro_dst); + ro->ro_dst.sa_len = sizeof(struct sockaddr_in); ro->ro_tableid = inp->inp_rtableid; satosin(&ro->ro_dst)->sin_addr = inp->inp_faddr; rtalloc_mpath(ro, &inp->inp_laddr.s_addr); |