lkml.org 
[lkml]   [1997]   [Feb]   [23]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
 
Messages in this thread
/
DateSun, 23 Feb 1997 10:54:11 +0000
FromWilliam Sowerbutts <>
SubjectRe: Quake Masquerading Module
At 05:01 23/02/97 +0100, Harald Hoyer wrote:
>HI,
>
>This quick hack to play Quake over the net with Masquerading-Support.
>I know that the initial Datastream has to be checked against
>a string like "\200\0\0\f\1QUAKE\0\3", but it's to late now and I have
>to study a lot in the next weeks.
>
>The File ip_masq_quake.c is attached. You may put it in your
>/usr/src/linux/net/ipv4 Directory, add ip_masq_quake.o to the other
>Masquerading-Modules in the Makefile, compile, load the module
>and stomp the other players to the ground!
>
> [snip]
>
>masq_quake_in (struct ip_masq_app *mapp, struct ip_masq *ms, struct
sk_buff **skb_p, struct device *dev)
>{
>	struct sk_buff *skb;
>	struct iphdr *iph;
>	__u16 *portptr, s_port;
>
>	if(!(ms->flags & IP_MASQ_F_NO_DPORT))
>		return 0;
>
>	skb = *skb_p;
>	iph = skb->nh.iph;

Shouldn't this read "iph = skb->h.iph;" ?

> 
>	portptr = (__u16 *)&(((char *)iph)[iph->ihl*4]);
>	s_port = portptr[0];
> 
>	if(s_port == ms->dport)
>		return 0;
>
>	ms->dport = s_port;
>	ms->flags &= ~IP_MASQ_F_NO_DPORT;
> 
>	return 0;
>}

At least, that's the way it works for my 2.0.29 kernel.
_________________________________________________________________________
William R Sowerbutts (BtG)                            btg@thepentagon.com
Coder / Guru / Nrrrd                 http://www.users.dircon.co.uk/~guru/
       main(){char*s=">#=0> ^#X@#@^7=";int c=0,m;for(;c<15;c++)for
         (m=-1;m<7;putchar(m++/6&c%3/2?10:s[c]-31&1<<m?42:32));}

\
 
 \ /
  Last update: 2005-03-22 13:39    [from the cache]
©2003-2008