Date: Sat, 6 Feb 2010 04:34:07 +0000 (UTC) From: Kip Macy <kmacy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r203540 - user/kmacy/head_flowtable_v6/sys/net Message-ID: <201002060434.o164Y7hZ053044@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kmacy Date: Sat Feb 6 04:34:07 2010 New Revision: 203540 URL: http://svn.freebsd.org/changeset/base/203540 Log: - store ports in network byte order Modified: user/kmacy/head_flowtable_v6/sys/net/flowtable.c Modified: user/kmacy/head_flowtable_v6/sys/net/flowtable.c ============================================================================== --- user/kmacy/head_flowtable_v6/sys/net/flowtable.c Sat Feb 6 04:22:54 2010 (r203539) +++ user/kmacy/head_flowtable_v6/sys/net/flowtable.c Sat Feb 6 04:34:07 2010 (r203540) @@ -470,8 +470,8 @@ ipv4_mbuf_demarshal(struct mbuf *m, stru switch (proto) { case IPPROTO_TCP: th = (struct tcphdr *)((caddr_t)ip + iphlen); - sport = ntohs(th->th_sport); - dport = ntohs(th->th_dport); + sport = th->th_sport; + dport = th->th_dport; if ((*flags & FL_HASH_ALL) && (th->th_flags & (TH_RST|TH_FIN))) *flags |= FL_STALE; @@ -1501,8 +1501,8 @@ flow_show(struct flowtable *ft, struct f inet_ntoa_r(*(struct in_addr *) &hashkey[2], daddr); if (ft->ft_flags & FL_HASH_ALL) { inet_ntoa_r(*(struct in_addr *) &hashkey[1], saddr); - sport = ((uint16_t *)hashkey)[0]; - dport = ((uint16_t *)hashkey)[1]; + sport = ntohs(((uint16_t *)hashkey)[0]); + dport = ntohs(((uint16_t *)hashkey)[1]); db_printf("%s:%d->%s:%d\n", saddr, sport, daddr, dport); } else db_printf("%s:\n", daddr);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002060434.o164Y7hZ053044>