M
markryde
Hello,
Followed here is a simplified code example of something which I
try to implement; in essence , I want to assign a value to a return
value of a method is C. I know, of course, that in this example I
can
get this by newskb->iph = iphdr (this also appears in a commented
line in the example below) ; but I want to achieve the same where
the left side is : ip_hdr(newskb). Alas, if I try this , I get
a compilation error about line 25.
line 25 is:
ip_hdr(newskb)=iphdr;
the error I get is:
lval.c:25: error: invalid lvalue in assignment
I use gcc-4.1.2-33c, and I compile without any flag.
I tried casting,
like : (struct iphdr*)ip_hdr(newskb)=iphdr;
or like:
ip_hdr(newskb)=(struct iphdr*)iphdr;
and got the same error.
Any ideas?
Regards,
Mark
Followed here is a simplified code example of something which I
try to implement; in essence , I want to assign a value to a return
value of a method is C. I know, of course, that in this example I
can
get this by newskb->iph = iphdr (this also appears in a commented
line in the example below) ; but I want to achieve the same where
the left side is : ip_hdr(newskb). Alas, if I try this , I get
a compilation error about line 25.
line 25 is:
ip_hdr(newskb)=iphdr;
the error I get is:
lval.c:25: error: invalid lvalue in assignment
I use gcc-4.1.2-33c, and I compile without any flag.
I tried casting,
like : (struct iphdr*)ip_hdr(newskb)=iphdr;
or like:
ip_hdr(newskb)=(struct iphdr*)iphdr;
and got the same error.
Any ideas?
Regards,
Mark