Deleted Added
full compact
in6_pcb.c (93593) in6_pcb.c (95023)
1/* $FreeBSD: head/sys/netinet6/in6_pcb.c 93593 2002-04-01 21:31:13Z jhb $ */
1/* $FreeBSD: head/sys/netinet6/in6_pcb.c 95023 2002-04-19 04:46:24Z suz $ */
2/* $KAME: in6_pcb.c,v 1.31 2001/05/21 05:45:10 jinmei Exp $ */
3
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

--- 327 unchanged lines hidden (view full) ---

337 struct sockaddr *nam;
338 struct thread *td;
339{
340 struct in6_addr *addr6;
341 register struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)nam;
342 int error;
343
344 /*
2/* $KAME: in6_pcb.c,v 1.31 2001/05/21 05:45:10 jinmei Exp $ */
3
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

--- 327 unchanged lines hidden (view full) ---

337 struct sockaddr *nam;
338 struct thread *td;
339{
340 struct in6_addr *addr6;
341 register struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)nam;
342 int error;
343
344 /*
345 * Call inner routine, to assign local interface address.
345 * Call inner routine, to assign local interface address.
346 * in6_pcbladdr() may automatically fill in sin6_scope_id.
346 */
347 if ((error = in6_pcbladdr(inp, nam, &addr6)) != 0)
348 return(error);
349
350 if (in6_pcblookup_hash(inp->inp_pcbinfo, &sin6->sin6_addr,
351 sin6->sin6_port,
352 IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)
353 ? addr6 : &inp->in6p_laddr,

--- 363 unchanged lines hidden (view full) ---

717
718 if (inp == NULL)
719 return EINVAL;
720 if (inp->inp_vflag & INP_IPV4) {
721 error = in_setsockaddr(so, nam);
722 if (error == 0)
723 in6_sin_2_v4mapsin6_in_sock(nam);
724 } else
347 */
348 if ((error = in6_pcbladdr(inp, nam, &addr6)) != 0)
349 return(error);
350
351 if (in6_pcblookup_hash(inp->inp_pcbinfo, &sin6->sin6_addr,
352 sin6->sin6_port,
353 IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)
354 ? addr6 : &inp->in6p_laddr,

--- 363 unchanged lines hidden (view full) ---

718
719 if (inp == NULL)
720 return EINVAL;
721 if (inp->inp_vflag & INP_IPV4) {
722 error = in_setsockaddr(so, nam);
723 if (error == 0)
724 in6_sin_2_v4mapsin6_in_sock(nam);
725 } else
726 /* scope issues will be handled in in6_setsockaddr(). */
725 error = in6_setsockaddr(so, nam);
726
727 return error;
728}
729
730int
731in6_mapped_peeraddr(struct socket *so, struct sockaddr **nam)
732{
733 struct inpcb *inp = sotoinpcb(so);
734 int error;
735
736 if (inp == NULL)
737 return EINVAL;
738 if (inp->inp_vflag & INP_IPV4) {
739 error = in_setpeeraddr(so, nam);
740 if (error == 0)
741 in6_sin_2_v4mapsin6_in_sock(nam);
742 } else
727 error = in6_setsockaddr(so, nam);
728
729 return error;
730}
731
732int
733in6_mapped_peeraddr(struct socket *so, struct sockaddr **nam)
734{
735 struct inpcb *inp = sotoinpcb(so);
736 int error;
737
738 if (inp == NULL)
739 return EINVAL;
740 if (inp->inp_vflag & INP_IPV4) {
741 error = in_setpeeraddr(so, nam);
742 if (error == 0)
743 in6_sin_2_v4mapsin6_in_sock(nam);
744 } else
745 /* scope issues will be handled in in6_setpeeraddr(). */
743 error = in6_setpeeraddr(so, nam);
744
745 return error;
746}
747
748/*
749 * Pass some notification to all connections of a protocol
750 * associated with address dst. The local address and/or port numbers

--- 354 unchanged lines hidden ---
746 error = in6_setpeeraddr(so, nam);
747
748 return error;
749}
750
751/*
752 * Pass some notification to all connections of a protocol
753 * associated with address dst. The local address and/or port numbers

--- 354 unchanged lines hidden ---