net: tcp2: Drop obsolete ip_get(), ip6_get() macros

After adding IPv6 support, there's no need for them.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
This commit is contained in:
Oleg Zhurakivskyy 2020-02-26 19:48:08 +02:00 committed by Jukka Rissanen
commit 27a12b78cb
2 changed files with 5 additions and 5 deletions

View file

@ -111,7 +111,8 @@ static union tcp_endpoint *tcp_endpoint_new(struct net_pkt *pkt, int src)
switch (af) {
case AF_INET: {
struct net_ipv4_hdr *ip = ip_get(pkt);
struct net_ipv4_hdr *ip = (struct net_ipv4_hdr *)
net_pkt_ip_data(pkt);
struct tcphdr *th = th_get(pkt);
ep->sin.sin_port = src ? th->th_sport : th->th_dport;
@ -121,8 +122,9 @@ static union tcp_endpoint *tcp_endpoint_new(struct net_pkt *pkt, int src)
break;
}
case AF_INET6: {
struct net_ipv6_hdr *ip = (void *)ip_get(pkt);
struct tcphdr *th = (void *)(ip + 1);
struct net_ipv6_hdr *ip = (struct net_ipv6_hdr *)
net_pkt_ip_data(pkt);
struct tcphdr *th = th_get(pkt);
ep->sin6.sin6_port = src ? th->th_sport : th->th_dport;

View file

@ -11,8 +11,6 @@
#define th_seq(_x) ntohl((_x)->th_seq)
#define th_ack(_x) ntohl((_x)->th_ack)
#define ip_get(_x) ((struct net_ipv4_hdr *) net_pkt_ip_data((_x)))
#define ip6_get(_x) ((struct net_ipv6_hdr *) net_pkt_ip_data((_x)))
#define tcp_slist(_slist, _op, _type, _link) \
({ \