* use M_ZERO flag with malloc instead of explicit zeroing.
* remove MULTI_SCOPE ifdef. Obtained from: Yandex LLC Sponsored by: Yandex LLC
This commit is contained in:
parent
41874e85d6
commit
80803aa289
@ -100,22 +100,14 @@ scope6_ifattach(struct ifnet *ifp)
|
||||
{
|
||||
struct scope6_id *sid;
|
||||
|
||||
sid = (struct scope6_id *)malloc(sizeof(*sid), M_IFADDR, M_WAITOK);
|
||||
bzero(sid, sizeof(*sid));
|
||||
|
||||
sid = malloc(sizeof(*sid), M_IFADDR, M_WAITOK | M_ZERO);
|
||||
/*
|
||||
* XXX: IPV6_ADDR_SCOPE_xxx macros are not standard.
|
||||
* Should we rather hardcode here?
|
||||
*/
|
||||
sid->s6id_list[IPV6_ADDR_SCOPE_INTFACELOCAL] = ifp->if_index;
|
||||
sid->s6id_list[IPV6_ADDR_SCOPE_LINKLOCAL] = ifp->if_index;
|
||||
#ifdef MULTI_SCOPE
|
||||
/* by default, we don't care about scope boundary for these scopes. */
|
||||
sid->s6id_list[IPV6_ADDR_SCOPE_SITELOCAL] = 1;
|
||||
sid->s6id_list[IPV6_ADDR_SCOPE_ORGLOCAL] = 1;
|
||||
#endif
|
||||
|
||||
return sid;
|
||||
return (sid);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
x
Reference in New Issue
Block a user