socket system call hook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am tring to hook socket system call and want to add some extra functionality for sys_bind. But i am not able to link sys_bind() function. It says unresolved symbol.
The code is as given below.

    unsigned long a[6];
        unsigned long a0,a1;
        int err, check_family = 0;
        struct sockaddr_un *sunaddr = NULL;

        if(call<1||call>SYS_RECVMSG)
            return -EINVAL;

        if (copy_from_user(a, args, nargs[call]))
            return -EFAULT;
       
        a0=a[0];
        a1=a[1];
   
        sunaddr = (struct sockaddr_un *)a1;
        if(sunaddr->sun_family == AF_UNIX)
            check_family = 1;
           
        err = sys_bind(a0,(struct sockaddr __user *)a1, a[2]);

    }

What might be the cause of not linking this call ....

In order to get it work, i copied the sys_bind call from the socket.c file to the .c file that i am using. Now the system is working fine. But is this approach is correct one ? or will it create some problems in future.

One more thing is sys_bind() is not defined as static ....

Thanks,
Deepak Joshi



What kind of emailer are you? Find out today - get a free analysis of your email personality. Take the quiz at the Yahoo! Mail Championship.

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux