Deleted Added
sdiff udiff text old ( 93593 ) new ( 95023 )
full compact
1/* $FreeBSD: head/sys/netinet6/in6_pcb.c 93593 2002-04-01 21:31:13Z jhb $ */
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.
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
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
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 ---