ip_nonlocal_bind and sendto

From: david
Date: Fri Feb 27 2009 - 04:10:47 EST


I've got a need to forge the source IP of UDP packets (a stupid syslog receiver app that I need to deal with)

I know that this can be done with raw sockets, but with the IP_nonlocal_bind option I thought that it may be possible to do this without dealing with raw sockets

so I have an app that does the socket call, followed by the bind call without any errors, but when I issue the sendto call it generates error 22 (invalid parameter) if the source IP doesn't exist on the local box somewhere.

is this the kernel that is doing whatever check is failing? or is glibc wrapping the kernel syscall and doing some additional checking?

if it is the kernel that's throwing the error, is there some way of disabling this check? or do I have to go to raw sockets?

David Lang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/