So, I don't follow this list, and don't know if anyone
has done this already, BUT,

the following patch to 
        linux/net/ipv4/ip_masq_raudio.c
should allow the same module to masquerade QT streamers.

This is based off the 2.2.10 kernel sources.
I'm not on any of these lists, so please direct queries
and responses to me in person if you care to have me
read them.

  One concern.  The qtss requires that the port
range start with an even port, and I couldn't figure
out how to get ip_masq_new to return an even port number,
so I just called it multiple times until it does.
If this will leak descriptors or if there is a
better way, please tell me.

        Thanks
                Yoav Yerushalmi
                [EMAIL PROTECTED]


*** ip_masq_raudio.c.orig       Sun Jun 27 22:34:12 1999
--- ip_masq_raudio.c    Sat Aug  7 02:38:25 1999
***************
*** 367,373 ****
                    {
                        state = 5;
                    }
!                   else if(*data == ';')
                    {
                        portend = data - 1;
                        firstport[firstportpos] = 0;
--- 367,373 ----
                    {
                        state = 5;
                    }
!                   else if((*data == ';') || (*data == '\r') || (*data == '\n'))
                    {
                        portend = data - 1;
                        firstport[firstportpos] = 0;
***************
*** 399,405 ****
                    }
                    break;
                case 6:
!                   if(*data == ';')
                    {
                        portend = data - 1;
                        secondport[secondportpos] = 0;
--- 399,405 ----
                    }
                    break;
                case 6:
!                 if ((*data == ';') || (*data == '\r') || (*data == '\n'))
                    {
                        portend = data - 1;
                        secondport[secondportpos] = 0;
***************
*** 429,441 ****
            char* tmpptr;
  
            udp_port = htons(simple_strtoul(firstport, &tmpptr, 10));
!           n_ms = ip_masq_new(IPPROTO_UDP,
!                              maddr, 0,
!                              ms->saddr, udp_port,
!                              ms->daddr, 0,
!                              IP_MASQ_F_NO_DPORT);
!           if (n_ms==NULL)
                return 0;
            
            ip_masq_listen(n_ms);
            ip_masq_control_add(n_ms, ms);
--- 429,444 ----
            char* tmpptr;
  
            udp_port = htons(simple_strtoul(firstport, &tmpptr, 10));
!           /* port must be even for apple -- is this a leak? */
!           do {
!             n_ms = ip_masq_new(IPPROTO_UDP,
!                                maddr, 0,
!                                ms->saddr, udp_port,
!                                ms->daddr, 0,
!                                IP_MASQ_F_NO_DPORT);
!             if (n_ms==NULL)
                return 0;
+           } while (ntohs(n_ms->mport) & 1);  
            
            ip_masq_listen(n_ms);
            ip_masq_control_add(n_ms, ms);
***************
*** 467,473 ****
                                         portstart, portend - portstart + 1,
                                         newbuf, strlen(newbuf));
            IP_MASQ_DEBUG(1-debug, "RTSP: rewrote client_port to %s\n", newbuf);
!           diff = strlen(newbuf) - (portend - portstart);
        }
        else
        {
--- 470,476 ----
                                         portstart, portend - portstart + 1,
                                         newbuf, strlen(newbuf));
            IP_MASQ_DEBUG(1-debug, "RTSP: rewrote client_port to %s\n", newbuf);
!           diff = strlen(newbuf) - (portend - portstart + 1);
        }
        else
        {
***************
*** 476,482 ****
            
        if(priv)
        {
!           priv->seen_start = 1;
            if(n_ms)
                priv->data_conn = n_ms;
            if(n_ms2)
--- 479,487 ----
            
        if(priv)
        {
!         /* priv->seen_start = 1; */
!         /* we have multiple streams to worry about, and redirects */
!         /* so we will be slower, but at least we'll work */
            if(n_ms)
                priv->data_conn = n_ms;
            if(n_ms2)


-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to