Subject: Re: help wanted with sys/net/if_ethersubr.c
To: None <>
From: =?iso-8859-1?q?Philip=20Christian?= <>
List: tech-kern
Date: 12/25/2003 21:34:05
I made the following changes to if_ethersubr.c

At the beginning of ether_input I added
   struct ether_header eh_temp;

Then I replaced the *mtod(m, struct ether_header *) =

   eh_temp = *eh
   *mtod(m, struct ether_header *) = eh_temp

I'm sure that it's not good code, but I now have a
proper ESIS table, which proves the point.

Hopefully someone on the list can come up with a
better way to copy eh into m when they are overlapping
in memory, and I can test it.

We fixed sending on a raw clnp socket a year ago,
maybe I will be able to receive as well...



 --- Philip Christian
<> wrote: > I have two
i386 laptops
> one is corrupting its ESIS routing table and the
> other
> is not
> in fact I suspect that it is corrupting the source
> mac
> address of all incoming OSI packets (ESIS, ISIS,
> etc)
> i sort of know why, here is what i know:-
> if one looks in sys/net/if_ethersubr.c then:-
> the process for receiving packets starts at line 651
> at line 674 you get
> eh = mtod(m,struct ether_header *);
> however inside the ifdef ISO bit at line 935
> you find
> *mtod(m, struct ether_header *) = *eh
> on the pc that has a corrupted esis table then
> before
> that line
> eh->ether_shost is correct but after it is corrupted
> on the pc that doesn't have a corrupted esis table
> eh->ether_shost is accurate both before and after
> the
> *mtod line of code
> also, on the pc with the corrupted table then
> mtod(m, struct ether_header * ) is three bytes
> higher
> than eh
> on the pc without the corrupted table mtod(m, struct
> ether_header * ) is in a totally different place to
> eh
> given line 674 I don't understand either
> also I didn't think that you could just do a
> *pointer
> = *other-pointer if they are pointers to structures
> ?
> I thought that you would have to do a bcopy or
> something if you want to copy a whole structure over
> ?
> so I am not sure what this line is trying to acheive
> I'm afraid that I'm not enough of a programmer to
> get
> any further than that...
> thanks for any help, Philip
> Yahoo! Messenger - Communicate instantly..."Ping" 
> your friends today! Download Messenger Now 

Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now