Re: about syslogd and printk()

Mike Jagdis (mike@roan.co.uk)
Wed, 22 Jul 1998 15:24:12 +0100 (GMT/BST)


I said:

> Actually it's SOCK_DGRAM and SOCK_PACKET not SOCK_RAW. Using SOCK_DGRAM
> works on ippp0, ppp0, lo, eth0, plip0 - but not sl0. Using SOCK_PACKET
> works on all. In all cases the socket was bound to the interface.
> I can send diald patches and the test code if it helps.

Oops, I was talking crap again. It's as non-functional on all
interfaces - when bound to a specific protocol. This is because
the dev_queue_xmit_nit() routine only checks the all protocols
list and not the specific protocol lists. Since the sl0 interface
was a diald proxy it only ever received outgoing packets so it
never printed anything. Patch follows. I think this is needed
in 2.2...

Mike

Oh, this is against 2.1.107. This is the end of dev_queue_xmit-nit().
It's pretty straight forward anyway.

--- net/core/dev.c.old Wed Jul 22 15:02:09 1998
+++ net/core/dev.c Wed Jul 22 15:08:50 1998
@@ -529,6 +529,20 @@
ptype->func(skb2, skb->dev, ptype);
}
}
+
+ for (ptype = ptype_base[ntohs(skb->protocol)&15]; ptype != NULL; ptype = ptype->next)
+ {
+ if (ptype->type == skb->protocol
+ && (!ptype->dev || ptype->dev==skb->dev))
+ {
+ struct sk_buff *skb2;
+
+ skb2=skb_clone(skb, GFP_ATOMIC);
+
+ if(skb2)
+ ptype->func(skb2, skb->dev, ptype);
+ }
+ } /* End of protocol list loop */
}

/*

-- 
.----------------------------------------------------------------------.
|  Mike Jagdis                  |  Internet:  mailto:mike@roan.co.uk   |
|  Roan Technology Ltd.         |                                      |
|  54A Peach Street, Wokingham  |  Telephone:  +44 118 989 0403        |
|  RG40 1XG, ENGLAND            |  Fax:        +44 118 989 1195        |
`----------------------------------------------------------------------'

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html