[NET]: Use hton{l,s}() for non-initializers.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
4244f8a9f8
commit
496c98dff8
@@ -611,8 +611,8 @@ static int ipgre_rcv(struct sk_buff *skb)
|
|||||||
* - When dealing with WCCPv2, Skip extra 4 bytes in GRE header
|
* - When dealing with WCCPv2, Skip extra 4 bytes in GRE header
|
||||||
*/
|
*/
|
||||||
if (flags == 0 &&
|
if (flags == 0 &&
|
||||||
skb->protocol == __constant_htons(ETH_P_WCCP)) {
|
skb->protocol == htons(ETH_P_WCCP)) {
|
||||||
skb->protocol = __constant_htons(ETH_P_IP);
|
skb->protocol = htons(ETH_P_IP);
|
||||||
if ((*(h + offset) & 0xF0) != 0x40)
|
if ((*(h + offset) & 0xF0) != 0x40)
|
||||||
offset += 4;
|
offset += 4;
|
||||||
}
|
}
|
||||||
|
@@ -273,10 +273,10 @@ static void tcp_build_and_update_options(__be32 *ptr, struct tcp_sock *tp,
|
|||||||
__u32 tstamp)
|
__u32 tstamp)
|
||||||
{
|
{
|
||||||
if (tp->rx_opt.tstamp_ok) {
|
if (tp->rx_opt.tstamp_ok) {
|
||||||
*ptr++ = __constant_htonl((TCPOPT_NOP << 24) |
|
*ptr++ = htonl((TCPOPT_NOP << 24) |
|
||||||
(TCPOPT_NOP << 16) |
|
(TCPOPT_NOP << 16) |
|
||||||
(TCPOPT_TIMESTAMP << 8) |
|
(TCPOPT_TIMESTAMP << 8) |
|
||||||
TCPOLEN_TIMESTAMP);
|
TCPOLEN_TIMESTAMP);
|
||||||
*ptr++ = htonl(tstamp);
|
*ptr++ = htonl(tstamp);
|
||||||
*ptr++ = htonl(tp->rx_opt.ts_recent);
|
*ptr++ = htonl(tp->rx_opt.ts_recent);
|
||||||
}
|
}
|
||||||
@@ -325,18 +325,27 @@ static void tcp_syn_build_options(__be32 *ptr, int mss, int ts, int sack,
|
|||||||
*ptr++ = htonl((TCPOPT_MSS << 24) | (TCPOLEN_MSS << 16) | mss);
|
*ptr++ = htonl((TCPOPT_MSS << 24) | (TCPOLEN_MSS << 16) | mss);
|
||||||
if (ts) {
|
if (ts) {
|
||||||
if(sack)
|
if(sack)
|
||||||
*ptr++ = __constant_htonl((TCPOPT_SACK_PERM << 24) | (TCPOLEN_SACK_PERM << 16) |
|
*ptr++ = htonl((TCPOPT_SACK_PERM << 24) |
|
||||||
(TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP);
|
(TCPOLEN_SACK_PERM << 16) |
|
||||||
|
(TCPOPT_TIMESTAMP << 8) |
|
||||||
|
TCPOLEN_TIMESTAMP);
|
||||||
else
|
else
|
||||||
*ptr++ = __constant_htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) |
|
*ptr++ = htonl((TCPOPT_NOP << 24) |
|
||||||
(TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP);
|
(TCPOPT_NOP << 16) |
|
||||||
|
(TCPOPT_TIMESTAMP << 8) |
|
||||||
|
TCPOLEN_TIMESTAMP);
|
||||||
*ptr++ = htonl(tstamp); /* TSVAL */
|
*ptr++ = htonl(tstamp); /* TSVAL */
|
||||||
*ptr++ = htonl(ts_recent); /* TSECR */
|
*ptr++ = htonl(ts_recent); /* TSECR */
|
||||||
} else if(sack)
|
} else if(sack)
|
||||||
*ptr++ = __constant_htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) |
|
*ptr++ = htonl((TCPOPT_NOP << 24) |
|
||||||
(TCPOPT_SACK_PERM << 8) | TCPOLEN_SACK_PERM);
|
(TCPOPT_NOP << 16) |
|
||||||
|
(TCPOPT_SACK_PERM << 8) |
|
||||||
|
TCPOLEN_SACK_PERM);
|
||||||
if (offer_wscale)
|
if (offer_wscale)
|
||||||
*ptr++ = htonl((TCPOPT_NOP << 24) | (TCPOPT_WINDOW << 16) | (TCPOLEN_WINDOW << 8) | (wscale));
|
*ptr++ = htonl((TCPOPT_NOP << 24) |
|
||||||
|
(TCPOPT_WINDOW << 16) |
|
||||||
|
(TCPOLEN_WINDOW << 8) |
|
||||||
|
(wscale));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This routine actually transmits TCP packets queued in by
|
/* This routine actually transmits TCP packets queued in by
|
||||||
|
Reference in New Issue
Block a user