[cgl_discussion] Prioritized protocol processing project announcement

Chris Wright chrisw at osdl.org
Fri Nov 5 11:30:29 PST 2004


* Chris Wright (chrisw at osdl.org) wrote:
> Some comments on the patch itself (no comment on the functionality yet,
> I'm still understanding it):

OK, one more point.

net/core/cong_ctrl.c::netif_check_high_pri_skb()
+       /* treat DNS/NTP packet as high priority packet. */
+       switch (iph->protocol) {
+
+       case IPPROTO_TCP:
+               {
+                       struct tcphdr *tcph;
+                       tcph = (struct tcphdr *)(skb->data + (iph->ihl * 4));
+                       sport = ntohs(tcph->source);
+                       break;
+               }
+       case IPPROTO_UDP:
+               {
+                       struct udphdr * udph;
+                       udph = (struct udphdr *)(skb->data + (iph->ihl * 4));
+                       sport = ntohs(udph->source);
+                       break;
+               }
+       default:
+               sport = 0;
+               break;
+       }
...
+       switch (sport) {
+
+       case CONG_CTRL_PORT_DNS:
+       case CONG_CTRL_PORT_NTP:
...
+               goto receive_high_pri_skb;

+       default:
+               break;
+       }

This has two problems.  One, as far as I can tell, there is no need for
two switch statements (minor issue).  Two, this is not the acceptable
kernel approach because it is hardcoding policy into the kernel.
This policy (make NTP and DNS traffic high priority) must be set from
userspace, and the kernel code should only there to make sure properly
marked packets get high priority.

thanks,
-chris
-- 
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net



More information about the cgl_discussion mailing list