lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CACPU8qJEjcrjdyp5f0_a+f48r9P8vNUav97zEfxQM58kD76Bug@mail.gmail.com>
Date:	Wed, 24 Aug 2011 20:01:05 +0800
From:	gengjia ding <gengjia.ding@...il.com>
To:	linux-kernel@...r.kernel.org
Subject: QoS:tcphdr:using tcp_hdr() unabled network

Hi,

trying to modify source file net/sched/sch_generic.c in Linux Kernel
2.6.37.6, added code:
+ #include <linux/tcp.h>
+ #include <net/tcp.h>
static int pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc* qdisc){
    + struct tcphdr *th = tcp_hdr(skb);
    + __be16 dport = th->dest;
}
I just want to get destination port of the transport header in the
socket buffer.
After recompiled the kernel and reboot, the network is unable to startup.

But when i exchange the code:
- #include <linux/tcp.h>
- #include <net/tcp.h>
static int pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc* qdisc){
    - struct tcphdr *th = tcp_hdr(skb);
    - __be16 dport = th->dest;
    + __be16 dport = *(__be16 *)((unsigned char*)(skb->transport_header + 2));
}
after recompile, the network is up.

Where did i make mistake when using the function tcp_hdr()?

Thanks,
--
Gavin Ding
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ