in6_ifattach.c (108172) | in6_ifattach.c (109623) |
---|---|
1/* $FreeBSD: head/sys/netinet6/in6_ifattach.c 108172 2002-12-22 05:35:03Z hsu $ */ | 1/* $FreeBSD: head/sys/netinet6/in6_ifattach.c 109623 2003-01-21 08:56:16Z alfred $ */ |
2/* $KAME: in6_ifattach.c,v 1.118 2001/05/24 07:44:00 itojun 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 --- 759 unchanged lines hidden (view full) --- 769 size_t olim; 770 771 olim = if_indexlim; 772 while (if_index >= if_indexlim) 773 if_indexlim <<= 1; 774 775 /* grow in6_ifstat */ 776 n = if_indexlim * sizeof(struct in6_ifstat *); | 2/* $KAME: in6_ifattach.c,v 1.118 2001/05/24 07:44:00 itojun 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 --- 759 unchanged lines hidden (view full) --- 769 size_t olim; 770 771 olim = if_indexlim; 772 while (if_index >= if_indexlim) 773 if_indexlim <<= 1; 774 775 /* grow in6_ifstat */ 776 n = if_indexlim * sizeof(struct in6_ifstat *); |
777 q = (caddr_t)malloc(n, M_IFADDR, M_WAITOK); | 777 q = (caddr_t)malloc(n, M_IFADDR, 0); |
778 bzero(q, n); 779 if (in6_ifstat) { 780 bcopy((caddr_t)in6_ifstat, q, 781 olim * sizeof(struct in6_ifstat *)); 782 free((caddr_t)in6_ifstat, M_IFADDR); 783 } 784 in6_ifstat = (struct in6_ifstat **)q; 785 in6_ifstatmax = if_indexlim; 786 787 /* grow icmp6_ifstat */ 788 n = if_indexlim * sizeof(struct icmp6_ifstat *); | 778 bzero(q, n); 779 if (in6_ifstat) { 780 bcopy((caddr_t)in6_ifstat, q, 781 olim * sizeof(struct in6_ifstat *)); 782 free((caddr_t)in6_ifstat, M_IFADDR); 783 } 784 in6_ifstat = (struct in6_ifstat **)q; 785 in6_ifstatmax = if_indexlim; 786 787 /* grow icmp6_ifstat */ 788 n = if_indexlim * sizeof(struct icmp6_ifstat *); |
789 q = (caddr_t)malloc(n, M_IFADDR, M_WAITOK); | 789 q = (caddr_t)malloc(n, M_IFADDR, 0); |
790 bzero(q, n); 791 if (icmp6_ifstat) { 792 bcopy((caddr_t)icmp6_ifstat, q, 793 olim * sizeof(struct icmp6_ifstat *)); 794 free((caddr_t)icmp6_ifstat, M_IFADDR); 795 } 796 icmp6_ifstat = (struct icmp6_ifstat **)q; 797 icmp6_ifstatmax = if_indexlim; --- 61 unchanged lines hidden (view full) --- 859#endif 860 861 /* update dynamically. */ 862 if (in6_maxmtu < ifp->if_mtu) 863 in6_maxmtu = ifp->if_mtu; 864 865 if (in6_ifstat[ifp->if_index] == NULL) { 866 in6_ifstat[ifp->if_index] = (struct in6_ifstat *) | 790 bzero(q, n); 791 if (icmp6_ifstat) { 792 bcopy((caddr_t)icmp6_ifstat, q, 793 olim * sizeof(struct icmp6_ifstat *)); 794 free((caddr_t)icmp6_ifstat, M_IFADDR); 795 } 796 icmp6_ifstat = (struct icmp6_ifstat **)q; 797 icmp6_ifstatmax = if_indexlim; --- 61 unchanged lines hidden (view full) --- 859#endif 860 861 /* update dynamically. */ 862 if (in6_maxmtu < ifp->if_mtu) 863 in6_maxmtu = ifp->if_mtu; 864 865 if (in6_ifstat[ifp->if_index] == NULL) { 866 in6_ifstat[ifp->if_index] = (struct in6_ifstat *) |
867 malloc(sizeof(struct in6_ifstat), M_IFADDR, M_WAITOK); | 867 malloc(sizeof(struct in6_ifstat), M_IFADDR, 0); |
868 bzero(in6_ifstat[ifp->if_index], sizeof(struct in6_ifstat)); 869 } 870 if (icmp6_ifstat[ifp->if_index] == NULL) { 871 icmp6_ifstat[ifp->if_index] = (struct icmp6_ifstat *) | 868 bzero(in6_ifstat[ifp->if_index], sizeof(struct in6_ifstat)); 869 } 870 if (icmp6_ifstat[ifp->if_index] == NULL) { 871 icmp6_ifstat[ifp->if_index] = (struct icmp6_ifstat *) |
872 malloc(sizeof(struct icmp6_ifstat), M_IFADDR, M_WAITOK); | 872 malloc(sizeof(struct icmp6_ifstat), M_IFADDR, 0); |
873 bzero(icmp6_ifstat[ifp->if_index], sizeof(struct icmp6_ifstat)); 874 } 875 876 /* initialize NDP variables */ 877 nd6_ifattach(ifp); 878} 879 880/* --- 170 unchanged lines hidden --- | 873 bzero(icmp6_ifstat[ifp->if_index], sizeof(struct icmp6_ifstat)); 874 } 875 876 /* initialize NDP variables */ 877 nd6_ifattach(ifp); 878} 879 880/* --- 170 unchanged lines hidden --- |