diff options
author | des <des@FreeBSD.org> | 2004-07-06 12:13:28 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2004-07-06 12:13:28 +0000 |
commit | 93180ebf2d291b1bba586c96cddb79d028f53e29 (patch) | |
tree | 26f30e4465d6cc4e19885a8912879ee00b6630f9 /lib/libalias/alias_db.c | |
parent | 858232d10a73b399e1b8a7eedd3dc58a225442a6 (diff) | |
download | FreeBSD-src-93180ebf2d291b1bba586c96cddb79d028f53e29.zip FreeBSD-src-93180ebf2d291b1bba586c96cddb79d028f53e29.tar.gz |
Introduce inline {ip,udp,tcp}_next() functions which take a pointer to an
{ip,udp,tcp} header and return a void * pointing to the payload (i.e. the
first byte past the end of the header and any required padding). Use them
consistently throughout libalias to a) reduce code duplication, b) improve
code legibility, c) get rid of a bunch of alignment warnings.
Diffstat (limited to 'lib/libalias/alias_db.c')
-rw-r--r-- | lib/libalias/alias_db.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libalias/alias_db.c b/lib/libalias/alias_db.c index e411066..f9c953b 100644 --- a/lib/libalias/alias_db.c +++ b/lib/libalias/alias_db.c @@ -1908,7 +1908,7 @@ packet size was altered is searched. int delta, ack_diff_min; u_long ack; - tc = (struct tcphdr *)((char *)pip + (pip->ip_hl << 2)); + tc = ip_next(pip); ack = tc->th_ack; delta = 0; @@ -1952,7 +1952,7 @@ packet size was altered is searched. int delta, seq_diff_min; u_long seq; - tc = (struct tcphdr *)((char *)pip + (pip->ip_hl << 2)); + tc = ip_next(pip); seq = tc->th_seq; delta = 0; @@ -1996,7 +1996,7 @@ been altered, then this list will begin to overwrite itself. int hlen, tlen, dlen; int i; - tc = (struct tcphdr *)((char *)pip + (pip->ip_hl << 2)); + tc = ip_next(pip); hlen = (pip->ip_hl + tc->th_off) << 2; tlen = ntohs(pip->ip_len); |