Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60678040 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller
Browse files

net: Use hton[sl]() instead of __constant_hton[sl]() where applicable

parent a574420f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ static int vlan_dev_rebuild_header(struct sk_buff *skb)

	switch (veth->h_vlan_encapsulated_proto) {
#ifdef CONFIG_INET
	case __constant_htons(ETH_P_IP):
	case htons(ETH_P_IP):

		/* TODO:  Confirm this will work with VLAN headers... */
		return arp_find(veth->h_dest, skb);
+4 −4
Original line number Diff line number Diff line
@@ -375,11 +375,11 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
			if (memcmp
			    (skb->data + 6, ethertype_ipv6,
			     sizeof(ethertype_ipv6)) == 0)
				skb->protocol = __constant_htons(ETH_P_IPV6);
				skb->protocol = htons(ETH_P_IPV6);
			else if (memcmp
				 (skb->data + 6, ethertype_ipv4,
				  sizeof(ethertype_ipv4)) == 0)
				skb->protocol = __constant_htons(ETH_P_IP);
				skb->protocol = htons(ETH_P_IP);
			else
				goto error;
			skb_pull(skb, sizeof(llc_oui_ipv4));
@@ -404,9 +404,9 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
			skb_reset_network_header(skb);
			iph = ip_hdr(skb);
			if (iph->version == 4)
				skb->protocol = __constant_htons(ETH_P_IP);
				skb->protocol = htons(ETH_P_IP);
			else if (iph->version == 6)
				skb->protocol = __constant_htons(ETH_P_IPV6);
				skb->protocol = htons(ETH_P_IPV6);
			else
				goto error;
			skb->pkt_type = PACKET_HOST;
+2 −2
Original line number Diff line number Diff line
@@ -1675,13 +1675,13 @@ static u16 simple_tx_hash(struct net_device *dev, struct sk_buff *skb)
	}

	switch (skb->protocol) {
	case __constant_htons(ETH_P_IP):
	case htons(ETH_P_IP):
		ip_proto = ip_hdr(skb)->protocol;
		addr1 = ip_hdr(skb)->saddr;
		addr2 = ip_hdr(skb)->daddr;
		ihl = ip_hdr(skb)->ihl;
		break;
	case __constant_htons(ETH_P_IPV6):
	case htons(ETH_P_IPV6):
		ip_proto = ipv6_hdr(skb)->nexthdr;
		addr1 = ipv6_hdr(skb)->saddr.s6_addr32[3];
		addr2 = ipv6_hdr(skb)->daddr.s6_addr32[3];
+1 −1
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ int eth_rebuild_header(struct sk_buff *skb)

	switch (eth->h_proto) {
#ifdef CONFIG_INET
	case __constant_htons(ETH_P_IP):
	case htons(ETH_P_IP):
		return arp_find(eth->h_dest, skb);
#endif
	default:
+2 −2
Original line number Diff line number Diff line
@@ -938,7 +938,7 @@ ip_vs_out(unsigned int hooknum, struct sk_buff *skb,

	EnterFunction(11);

	af = (skb->protocol == __constant_htons(ETH_P_IP)) ? AF_INET : AF_INET6;
	af = (skb->protocol == htons(ETH_P_IP)) ? AF_INET : AF_INET6;

	if (skb->ipvs_property)
		return NF_ACCEPT;
@@ -1258,7 +1258,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb,
	struct ip_vs_conn *cp;
	int ret, restart, af;

	af = (skb->protocol == __constant_htons(ETH_P_IP)) ? AF_INET : AF_INET6;
	af = (skb->protocol == htons(ETH_P_IP)) ? AF_INET : AF_INET6;

	ip_vs_fill_iphdr(af, skb_network_header(skb), &iph);

Loading