[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Problem in resolving MAC address,

Hello All,
   I have a function which gets as input a IP packet. I build the frame
header for this IP packet and then send it across.

To do this I do the following things,

             xyz( sk_buff skb)
                skb->dev = [put device here];
                skb->nh.iph->saddr = [alter the saddress to this m/c]
                skb->nh.iph->raddr = [      ,,  router address]
                if (!skb->dst)
                    [allocate dst_entry stucture]
                rt = (struct rtable *) skb->dst;  [I point to rtable]

    **         ip_route_output(&rt, skb->nh.iph->raddr,
                                      skb->nh.iph->saddr, 1, 0 )

               [In above function call I get the route table entry filled]
               hdr = (struct ethhdr *)skb_push( skb, ETH_HLEN);
               memcpy(hdr->h_source, skb->dev->dev_addr,
               hdr->h_proto = __constant_htons(ETH_P_IP);

    **         arp_find(skb->dev->h_dest, skb);

    **         dev_queue_xmit(skb);


The problem is my arp_find call fails and does not reslove the hardware
address but craches the system. If insted of callinf the arp_find if
I hard code the mac address of my router every thing works fine. I am
using Kernel 2.2.13.

Can any one of you tell me where am I going wrong. Should I save any
of the pointers or do some additional assignments before calling or
after calling arp_find.


                  In a world without fences who needs Gates...
Syed Khaleelulla,
Software Engineer,
Wipro Global R&D,
26, Hosur Main Road, Bommanhalli, 
Bangalore - 560068, India.
Tel: 91-80-5722293/6 Extn- 2151.
Fax: 91-80-5722696.
The World's First SEI CMM Level 5 Software Services Company.