Problem in resolving MAC address,

From: Syed Khaleelulla (Syed.Khaleelulla@wipro.com)
Date: Tue Jun 06 2000 - 01:43:04 EST


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,
                                            skb->dev->addr_len);
               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.

Waiting for help.

-Thanks & Regards,
Syed Khaleelulla.
--------------

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.rutgers.edu



This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:33 EST