in6_ifattach.c (33cde13046eaba762428c55bb5d5e07c1a7c5f33) in6_ifattach.c (f6dfe47a145263dc5eb67fa4789925ab708709bc)
1/*-
2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

883 ndi->randomid);
884 }
885 bcopy(ndi->randomid, retbuf, 8);
886
887 return (0);
888}
889
890void
1/*-
2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

883 ndi->randomid);
884 }
885 bcopy(ndi->randomid, retbuf, 8);
886
887 return (0);
888}
889
890void
891in6_tmpaddrtimer(void *ignored_arg)
891in6_tmpaddrtimer(void *arg)
892{
892{
893 CURVNET_SET((struct vnet *) arg);
893 INIT_VNET_NET(curvnet);
894 INIT_VNET_INET6(curvnet);
895 struct nd_ifinfo *ndi;
896 u_int8_t nullbuf[8];
897 struct ifnet *ifp;
898
899 callout_reset(&V_in6_tmpaddrtimer_ch,
900 (V_ip6_temp_preferred_lifetime - V_ip6_desync_factor -
894 INIT_VNET_NET(curvnet);
895 INIT_VNET_INET6(curvnet);
896 struct nd_ifinfo *ndi;
897 u_int8_t nullbuf[8];
898 struct ifnet *ifp;
899
900 callout_reset(&V_in6_tmpaddrtimer_ch,
901 (V_ip6_temp_preferred_lifetime - V_ip6_desync_factor -
901 V_ip6_temp_regen_advance) * hz, in6_tmpaddrtimer, NULL);
902 V_ip6_temp_regen_advance) * hz, in6_tmpaddrtimer, curvnet);
902
903 bzero(nullbuf, sizeof(nullbuf));
904 for (ifp = TAILQ_FIRST(&V_ifnet); ifp;
905 ifp = TAILQ_NEXT(ifp, if_list)) {
906 ndi = ND_IFINFO(ifp);
907 if (bcmp(ndi->randomid, nullbuf, sizeof(nullbuf)) != 0) {
908 /*
909 * We've been generating a random ID on this interface.
910 * Create a new one.
911 */
912 (void)generate_tmp_ifid(ndi->randomseed0,
913 ndi->randomseed1, ndi->randomid);
914 }
915 }
916
903
904 bzero(nullbuf, sizeof(nullbuf));
905 for (ifp = TAILQ_FIRST(&V_ifnet); ifp;
906 ifp = TAILQ_NEXT(ifp, if_list)) {
907 ndi = ND_IFINFO(ifp);
908 if (bcmp(ndi->randomid, nullbuf, sizeof(nullbuf)) != 0) {
909 /*
910 * We've been generating a random ID on this interface.
911 * Create a new one.
912 */
913 (void)generate_tmp_ifid(ndi->randomseed0,
914 ndi->randomseed1, ndi->randomid);
915 }
916 }
917
918 CURVNET_RESTORE();
917}
918
919static void
920in6_purgemaddrs(struct ifnet *ifp)
921{
919}
920
921static void
922in6_purgemaddrs(struct ifnet *ifp)
923{
922 INIT_VNET_INET6(ifp->if_vnet);
923 LIST_HEAD(,in6_multi) purgeinms;
924 struct in6_multi *inm, *tinm;
925 struct ifmultiaddr *ifma;
926
927 LIST_INIT(&purgeinms);
928 IN6_MULTI_LOCK();
929
930 /*

--- 23 unchanged lines hidden ---
924 LIST_HEAD(,in6_multi) purgeinms;
925 struct in6_multi *inm, *tinm;
926 struct ifmultiaddr *ifma;
927
928 LIST_INIT(&purgeinms);
929 IN6_MULTI_LOCK();
930
931 /*

--- 23 unchanged lines hidden ---