netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ip_nonlocal_bind and sendto (fwd)
@ 2009-02-27  9:20 david
  2009-02-27 14:50 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: david @ 2009-02-27  9:20 UTC (permalink / raw)
  To: netdev

I initially sent this to lkml, but then realized I should have tried here

---------- Forwarded message ----------
Date: Fri, 27 Feb 2009 01:10:24 -0800 (PST)
From: david@lang.hm
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: ip_nonlocal_bind and sendto

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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-02-27 22:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-27  9:20 ip_nonlocal_bind and sendto (fwd) david
2009-02-27 14:50 ` Arnaldo Carvalho de Melo
2009-02-27 17:50   ` david
2009-02-27 22:07     ` david

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).