Re: [mpls-linux-general] IOCTL function SIOCMPLSNHLFEGET
Status: Beta
Brought to you by:
jleu
|
From: James R. L. <jl...@mi...> - 2002-10-28 21:48:37
|
I've applied your fix to my developement tree.
Thank you.
On Mon, Oct 28, 2002 at 03:25:54PM +0100, Georg Klug wrote:
> Hi all,
>
> playing a bit with the nice IOCTL functions of the MPLS patched
> kernel (v1.170), I found out that the SIOCMPLSNHLFEGET ioctl does
> not work correctly. The problem lies probably in the function
> mpls_get_out_label(), where a memcpy of the looked up info just
> changes the local variable label.
> INHO a memcpy is wrong here, due to the fact the two arguments
> point to different types. So I tried the following change in net/mpls/:
>
>
> -------------------------------- snip -------------
> diff -u mpls_out_info.c mpls_out_info.c.orig
> --- mpls_out_info.c Mon Oct 28 14:50:00 2002
> +++ mpls_out_info.c.orig Fri Sep 27 11:01:44 2002
> @@ -290,14 +290,8 @@
> retval = -ESRCH;
> goto mpls_get_out_label_cleanup;
> }
> -// memcpy(&(out->mol_label),&label,sizeof(struct mpls_label));
> - out->mol_age = moi->moi_age;
> - out->mol_mtu = moi->moi_mtu;
> - out->mol_propogate_ttl = moi->moi_propogate_ttl;
> - out->mol_label.ml_index = moi->moi_ifindex;
> - out->mol_label.ml_type = MPLS_LABEL_KEY;
> - out->mol_label.u.ml_key = moi->moi_key;
> - out->mol_label.__refcnt = moi->__refcnt;
> + memcpy(&(out->mol_label),&label,sizeof(struct mpls_label));
> + out->mol_age = moi->moi_age;
> mpls_out_info_release(moi);
> } else {
> retval = -ENXIO;
> -------------------------------------------------
>
> What do you think about this patch?
>
> Kind regards,
> Georg Klug
>
>
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> mpls-linux-general mailing list
> mpl...@li...
> https://lists.sourceforge.net/lists/listinfo/mpls-linux-general
--
James R. Leu
|