Messages in this thread Patch in this message | | | From | <> | Subject | RE: odd tcpdump | Date | Thu, 26 Nov 1998 14:37:36 +0100 |
| |
Hello,
The problem you described is also 2.1 kernel-versions. When sending out packets, for syncPPP devices a 10 byte long fake header is build (isdn_net.c:isdn_net_header), which later is removed (isdn_ppp.c:isdn_ppp_xmit). tcpdump reads these outgoing packets with fake-header from the packet-socket. Incoming packets don't have this header, so here tcpdump works ok. I have a patch for 2.1 kernels, which works fine for me, but i really dont know, if it is the correct solution. Instead of creating a fake-header, it sets dev->hard_header_len to ensure there is room in the header.
Lars Heete
--- linux-2.1.122/drivers/isdn/isdn_net.c Sun May 24 17:33:57 1998 +++ linux/drivers/isdn/isdn_net.c Thu Sep 17 14:51:23 1998 @@ -2595,22 +2595,35 @@ lp->chargeint = cfg->chargeint * HZ; } if (cfg->p_encap != lp->p_encap) { - if (cfg->p_encap == ISDN_NET_ENCAP_RAWIP) { + switch (cfg->p_encap) { + case ISDN_NET_ENCAP_RAWIP: p->dev.hard_header = NULL; p->dev.hard_header_cache = NULL; p->dev.header_cache_update = NULL; p->dev.flags = IFF_NOARP|IFF_POINTOPOINT; - } else { + break; + + case ISDN_NET_ENCAP_ETHER: p->dev.hard_header = isdn_net_header; - if (cfg->p_encap == ISDN_NET_ENCAP_ETHER) { - p->dev.hard_header_cache = lp->org_hhc; - p->dev.header_cache_update = lp->org_hcu; - p->dev.flags = IFF_BROADCAST | IFF_MULTICAST; - } else { - p->dev.hard_header_cache = NULL; - p->dev.header_cache_update = NULL; - p->dev.flags = IFF_NOARP|IFF_POINTOPOINT; - } + p->dev.hard_header_cache = lp->org_hhc; + p->dev.header_cache_update = lp->org_hcu; + p->dev.flags = IFF_BROADCAST | IFF_MULTICAST; + break; + + case ISDN_NET_ENCAP_SYNCPPP: + p->dev.hard_header = NULL; + p->dev.hard_header_len = IPPP_MAX_HEADER; + p->dev.hard_header_cache = NULL; + p->dev.header_cache_update = NULL; + p->dev.flags = IFF_NOARP|IFF_POINTOPOINT; + break; + + default: + p->dev.hard_header = isdn_net_header; + p->dev.hard_header_cache = NULL; + p->dev.header_cache_update = NULL; + p->dev.flags = IFF_NOARP|IFF_POINTOPOINT; + break; } } lp->p_encap = cfg->p_encap; --- linux-2.1.122/drivers/isdn/isdn_ppp.c Thu Apr 2 20:47:01 1998 +++ linux/drivers/isdn/isdn_ppp.c Thu Sep 17 14:52:13 1998 @@ -1342,13 +1342,14 @@ /* * after this line .. requeueing in the device queue is no longer allowed!!! */ - +#if 0 /* Pull off the fake header we stuck on earlier to keep * the fragemntation code happy. * this will break the ISDN_SYNCPPP_READDRESS hack a few lines * above. So, enabling this is no longer allowed */ skb_pull(skb,IPPP_MAX_HEADER); +#endif if (ipt->debug & 0x4) printk(KERN_DEBUG "xmit skb, len %d\n", (int) skb->len); | |