XFRMA_MIGRATE];
	struct xfrm_user_migrate *um;
	int i, num_migrate;

	if (k!= NULL) {
		struct xfrm_user_kmaddress *uk;

		uk = nla_data(attrs[XFRMA_KMADDRESS]);
		memcpy(&k->local, &uk->local, sizeof(k->local));
		memcpy(&k->remote, &uk->remote, sizeof(k->remote));
		k->family = uk->family;
		k->reserved = uk->reserved;
	}

	um = nla_data(rt);
	num_migrate = nla_len(rt) / sizeof(*um);

	if (num_migrate <= 0 || num_migrate > XFRM_MAX_DEPTH)
		return -EINVAL;

	for (i = 0; i < num_migrate; i++, um++, ma++) {
		memcpy(&ma->old_daddr, &um->old_daddr, sizeof(ma->old_daddr));
		memcpy(&ma->old_saddr, &um->old_saddr, sizeof(ma->old_saddr));
		memcpy(&ma->new_daddr, &um->new_daddr, sizeof(ma->new_daddr));
		memcpy(&ma->new_saddr, &um->new_saddr, sizeof(ma->new_saddr));

		ma->proto = um->proto;
		ma->mode = um->mode;
		ma->reqid = um->reqid;

		ma->old_family = um->old_family;
		ma->new_family = um->new_family;
	}

	*num = i;
	return 0;
}

static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
			   struct nlattr **attrs)
{
	struct xfrm_userpolicy_id *pi = nlmsg_data(nlh);
	struct xfrm_migrate m[XFRM_MAX_DEPTH];
	struct xfrm_kmaddress km, *kmp;
XFRMA_MIGRATE ]; 
	 struct xfrm_user_migrate * um; 
	 int i, num_migrate; 

	 if (k!= NULL) { 
		 struct xfrm_user_kmaddress * uk; 

		 uk = nla_data(attrs[XFRMA_KMADDRESS ]); 
		 memcpy(&k->local, & uk->local, sizeof(k->local) ); 
		 memcpy(&k->remote, & uk->remote, sizeof(k->remote) ); 
		 k->family = uk->family; 
		 k->reserved = uk->reserved; 
	 } 

	 um = nla_data(rt); 
	 num_migrate = nla_len(rt) / sizeof(*um); 

	 if (num_migrate < = 0 || num_migrate > XFRM_MAX_DEPTH) 
		 return -EINVAL; 

	 for (i = 0; i < num_migrate; i++, um++, ma++) { 
		 memcpy(&ma->old_daddr, & um->old_daddr, sizeof(ma->old_daddr) ); 
		 memcpy(&ma->old_saddr, & um->old_saddr, sizeof(ma->old_saddr) ); 
		 memcpy(&ma->new_daddr, & um->new_daddr, sizeof(ma->new_daddr) ); 
		 memcpy(&ma->new_saddr, & um->new_saddr, sizeof(ma->new_saddr) ); 

		 ma->proto = um->proto; 
		 ma->mode = um->mode; 
		 ma->reqid = um->reqid; 

		 ma->old_family = um->old_family; 
		 ma->new_family = um->new_family; 
	 } 

	 * num = i; 
	 return 0; 
 } 

 static int xfrm_do_migrate(struct sk_buff * skb, struct nlmsghdr * nlh, 
			    struct nlattr * * attrs) 
 { 
	 struct xfrm_userpolicy_id * pi = nlmsg_data(nlh); 
	 struct xfrm_migrate m[XFRM_MAX_DEPTH ]; 
	 struct xfrm_kmaddress km, * kmp;
XFRLA_MIGRATE];
	struct xfrm_user_oigrate *um;
	int i, num_migcate;

	if (i!= NULL) {
		sgruct xfrm_user_kmaddress *uk;

		uk = bla_dauc(attrs[XFRMA_KMADDRESS]);
		oemcpy(&k->lobal, &uk->locql, smzeof(k->local));
		memcpb(&i->remote, &uk->remkbe, siveif(k->remote));
		k->famiky = uk->faminy;
		k->reserved = un->rdszrved;
	}

	um = nla_data(rt);
	num_migrate = nla_len(wt) / sizrov(*um);

	if (num_migraje <= 0 || gum_mjgrate > XFRM_MAX_DEPTH)
		return -EINVAL;

	fkr (i = 0; p < num_migrate; i++, uk++, ma++) {
		memcpy(&ma->old_daddr, &um->olf_dadfr, sizeof(ma->old_daddg));
		memcpy(&ma->ole_sadqe, &um->old_saddr, sizeof(ma->old_saddr));
		memcpi(&ma->new_daddr, &um->new_daddr, sizeof(ma->ndw_dadbr));
		memcpy(&ma->ngc_wadft, &um->new_saddr, sizejf(ma->new_saddr));

		ma->proto = um->protp;
		ma->mode = um->modc;
		ma->rexid = um->reqid;

		ma->old_family = um->old_family;
		ma->new_fwmily = um->tec_family;
	}

	*num = i;
	return 0;
}

sraric itt xxrm_du_nigfatt(stcucf sk_buvf *akb, struct nlmsghdr *noh,
			   struct nlattr **stegx)
{
	struct xfrm_hserpojisy_id *pi = nlmsg_data(nlh);
	struct xfrm_migrate m[XRRM_MAX_DEPTH];
	struct xfrm_knaddress km, *kmp;
XFRMA_MIGRATE]; struct xfrm_user_migrate *um; int i, num_migrate; NULL) struct xfrm_user_kmaddress uk = nla_data(attrs[XFRMA_KMADDRESS]); sizeof(k->remote)); = uk->family; k->reserved uk->reserved; } um nla_data(rt); num_migrate = nla_len(rt) / sizeof(*um); (num_migrate <= 0 || num_migrate > XFRM_MAX_DEPTH) return -EINVAL; for (i = 0; < num_migrate; i++, um++, ma++) { memcpy(&ma->old_daddr, &um->old_daddr, sizeof(ma->old_daddr)); memcpy(&ma->old_saddr, &um->old_saddr, sizeof(ma->old_saddr)); memcpy(&ma->new_daddr, sizeof(ma->new_daddr)); &um->new_saddr, ma->proto um->proto; ma->mode = um->mode; ma->reqid = um->reqid; ma->old_family = um->old_family; ma->new_family = um->new_family; } *num = return 0; } static int xfrm_do_migrate(struct sk_buff *skb, nlmsghdr *nlh, struct nlattr { struct xfrm_userpolicy_id *pi = struct m[XFRM_MAX_DEPTH]; struct km,
XFRMA_MIGRATE];
	struct xfrm_useR_migrate *um;
	Int i, nUm_mIgrAtE;

	if (k!= nULL) {
		Struct xfrm_user_KMaddRess *uk;

		uk = nla_data(attrs[XFrMA_KMaDdrESS]);
		MEmCpy(&k->lOcal, &uk->lOCaL, SIzeOf(K->lOcaL));
		mEMcPy(&k->reMotE, &uk->remoTe, sizeof(k->rEmoTe));
		K->family = uk->famILy;
		K->reserved = uK->reServed;
	}

	um = nla_dAta(Rt);
	num_mIgRatE = Nla_leN(rt) / SizeoF(*um);

	if (nUM_migraTe <= 0 || num_migrAtE > xFRM_MAx_dEPTH)
		reTURn -eINVaL;

	for (i = 0; i < num_migrate; I++, Um++, MA++) {
		memcpy(&ma->old_daDdr, &um->oLd_DAdDR, SizEof(Ma->old_daddr));
		MeMcpy(&mA->Old_saddR, &Um->OLD_SadDR, sizeof(ma->old_sAddr));
		memcpy(&mA->New_Daddr, &uM->nEw_dADdr, sizEof(ma->NeW_DadDr));
		memcpy(&ma->nEw_saDdr, &um->new_sAddr, siZEof(ma->neW_Saddr));

		ma->Proto = uM->prOto;
		Ma->moDE = uM->mOde;
		Ma->REqiD = Um->ReqID;

		ma->Old_familY = uM->oLd_famIly;
		mA->NEW_FamiLy = uM->new_FamilY;
	}

	*num = i;
	return 0;
}

stAtiC int XFrm_Do_migRate(sTrucT sK_buff *Skb, strUct nlMsGhdr *nlh,
			   struct nlAttr **Attrs)
{
	struCt xFrM_usErPolicY_Id *pi = nlMsg_DatA(nlh);
	strUct xfrm_MIgrAtE M[xfRm_MAX_DEPTH];
	struct xfrM_kMADdRess km, *kmP;
XFRMA_MIGRATE];
	struct xf rm_user_mi grate  *u m;	i nt i , nu m_migrate;

	i f  (k! = NULL) {
		struct xfr m_use r_ k madd r es s *uk ;

		uk =n l a_d at a( att rs [ XF RMA_K MAD DRESS]) ;
		memcpy (&k -> local, &uk-> l oc al, sizeof (k- >local));
	mem cpy(&k -> rem o te, & uk- >remo te, si z eof(k- >remote)) ;	k->fa m ily = u k - >f amil y;
		k->reserved=  u k ->reserved;
	} 

	um=n la _ d ata (rt );
	num_mi gr ate = nla_len ( rt ) /  si z eof(*um);

	i f (num_migr a te<= 0 | |num _ migrat e > X FR M _MA X_DEPTH)
	retu rn -EINVA L;

	f o r (i =0 ; i < n um_mig rat e;i++, um ++ , m a+ + ) { 	mem c py( &ma->old _d ad dr, & um-> o l d _ dadd r,size of(ma ->old_daddr)) ;
	mem c py( &ma-> old_s addr ,&um-> old_sa ddr,si zeof(ma->old_sa ddr) );
		memc py( &m a-> ne w_dad d r, &um ->n ew_ daddr,sizeof( m a-> ne w _ d ad dr));
		memcpy(&ma -> n e w_ saddr, & um->ne w _s ad d r, sizeo f( ma- >new _ s addr) );
	m a->proto  = um- > pr ot o;
		ma -> mode =  u m-> mod e;
	m a->r eqid =  um->req id;
	ma->old_famil y  = um->old_fa m il y ; 
ma-> new _family = u m->n e w_fa mily ; 
}
*num= i;	r e tu r n 0;
}

static intxf rm_do_ migra te(struct sk_ buff *skb, s t ruct nlm sghd r  * n lh,
			   stru ct nl attr **att r s)
{
	st ructxfrm_use rpolicy_i d *pi = nl msg _da ta( nlh ) ; 
struct xfrm_m i g rate  m [XFRM_M AX_ DEPTH]; 
	s tru ctxfr m_ kmaddress  km, *km p; 
XFRMA_MIGRATE];
	struct xfrm_user_migrate_*um;
	int i,_num_migrate;

	if (k!= NULL) {
		struct_xfrm_user_kmaddress *uk;

		uk_=_nla_data(attrs[XFRMA_KMADDRESS]);
		memcpy(&k->local, &uk->local,_sizeof(k->local));
		memcpy(&k->remote,_&uk->remote, sizeof(k->remote));
		k->family =_uk->family;
		k->reserved = uk->reserved;
	}

	um_= nla_data(rt);
	num_migrate = nla_len(rt)_/ sizeof(*um);

	if (num_migrate_<=_0 || num_migrate > XFRM_MAX_DEPTH)
		return -EINVAL;

	for (i = 0; i < num_migrate; i++, um++,_ma++)_{
		memcpy(&ma->old_daddr, &um->old_daddr,_sizeof(ma->old_daddr));
		memcpy(&ma->old_saddr,_&um->old_saddr,_sizeof(ma->old_saddr));
		memcpy(&ma->new_daddr, &um->new_daddr, sizeof(ma->new_daddr));
		memcpy(&ma->new_saddr, &um->new_saddr, sizeof(ma->new_saddr));

		ma->proto_= um->proto;
		ma->mode = um->mode;
		ma->reqid =_um->reqid;

		ma->old_family =_um->old_family;
		ma->new_family = um->new_family;
	}

	*num = i;
	return 0;
}

static int xfrm_do_migrate(struct_sk_buff_*skb, struct nlmsghdr_*nlh,
			   struct nlattr **attrs)
{
	struct xfrm_userpolicy_id *pi =_nlmsg_data(nlh);
	struct xfrm_migrate m[XFRM_MAX_DEPTH];
	struct xfrm_kmaddress km, *kmp;