hey sixerjman,
thank you for your reply. I am modifying an Openwrt embedded Linux with Kernel v3.18.
I want to clearify two things: First of all, I am not looking for the source address, but for the source port! The second thing is that both of your links refer to user space functions.
I did some research with an old book about kernel development and i found out that the socket.c file mainly deals with the OSI application layer and on this level, source and destination ports of sockets are not defined yet, so i have to go deeper to transport layer (tcp.c and udp.c in the Linux kernel). I am not sure if this is right, but i will do some further evaluation. I hope this will be the solution.
Nevertheless, if someone still has a way to get source ports from the connect() syscall, feel free to contribute!
|