in6_pcb.c (105199) | in6_pcb.c (109623) |
---|---|
1/* $FreeBSD: head/sys/netinet6/in6_pcb.c 105199 2002-10-16 02:25:05Z sam $ */ | 1/* $FreeBSD: head/sys/netinet6/in6_pcb.c 109623 2003-01-21 08:56:16Z alfred $ */ |
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 --- 625 unchanged lines hidden (view full) --- 635 636struct sockaddr * 637in6_sockaddr(port, addr_p) 638 in_port_t port; 639 struct in6_addr *addr_p; 640{ 641 struct sockaddr_in6 *sin6; 642 | 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 --- 625 unchanged lines hidden (view full) --- 635 636struct sockaddr * 637in6_sockaddr(port, addr_p) 638 in_port_t port; 639 struct in6_addr *addr_p; 640{ 641 struct sockaddr_in6 *sin6; 642 |
643 MALLOC(sin6, struct sockaddr_in6 *, sizeof *sin6, M_SONAME, M_WAITOK); | 643 MALLOC(sin6, struct sockaddr_in6 *, sizeof *sin6, M_SONAME, 0); |
644 bzero(sin6, sizeof *sin6); 645 sin6->sin6_family = AF_INET6; 646 sin6->sin6_len = sizeof(*sin6); 647 sin6->sin6_port = port; 648 sin6->sin6_addr = *addr_p; 649 if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr)) 650 sin6->sin6_scope_id = ntohs(sin6->sin6_addr.s6_addr16[1]); 651 else --- 14 unchanged lines hidden (view full) --- 666 667 bzero(&sin, sizeof sin); 668 sin.sin_family = AF_INET; 669 sin.sin_len = sizeof(sin); 670 sin.sin_port = port; 671 sin.sin_addr = *addr_p; 672 673 MALLOC(sin6_p, struct sockaddr_in6 *, sizeof *sin6_p, M_SONAME, | 644 bzero(sin6, sizeof *sin6); 645 sin6->sin6_family = AF_INET6; 646 sin6->sin6_len = sizeof(*sin6); 647 sin6->sin6_port = port; 648 sin6->sin6_addr = *addr_p; 649 if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr)) 650 sin6->sin6_scope_id = ntohs(sin6->sin6_addr.s6_addr16[1]); 651 else --- 14 unchanged lines hidden (view full) --- 666 667 bzero(&sin, sizeof sin); 668 sin.sin_family = AF_INET; 669 sin.sin_len = sizeof(sin); 670 sin.sin_port = port; 671 sin.sin_addr = *addr_p; 672 673 MALLOC(sin6_p, struct sockaddr_in6 *, sizeof *sin6_p, M_SONAME, |
674 M_WAITOK); | 674 0); |
675 in6_sin_2_v4mapsin6(&sin, sin6_p); 676 677 return (struct sockaddr *)sin6_p; 678} 679 680/* 681 * The calling convention of in6_setsockaddr() and in6_setpeeraddr() was 682 * modified to match the pru_sockaddr() and pru_peeraddr() entry points --- 451 unchanged lines hidden --- | 675 in6_sin_2_v4mapsin6(&sin, sin6_p); 676 677 return (struct sockaddr *)sin6_p; 678} 679 680/* 681 * The calling convention of in6_setsockaddr() and in6_setpeeraddr() was 682 * modified to match the pru_sockaddr() and pru_peeraddr() entry points --- 451 unchanged lines hidden --- |