Skip to content

Commit e075880

Browse files
committed
gtp: move debugging to skbuff build helper function
Move debugging to the routine to build GTP packets in preparation for supporting IPv4-in-IPv6-GTP and IPv6-in-IPv4-GTP. Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent e4f88f7 commit e075880

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/net/gtp.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,9 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev,
10601060
gtp_set_pktinfo_ipv4(pktinfo, pctx->sk, iph, pctx, rt, &fl4, dev);
10611061
gtp_push_header(skb, pktinfo);
10621062

1063+
netdev_dbg(dev, "gtp -> IP src: %pI4 dst: %pI4\n",
1064+
&iph->saddr, &iph->daddr);
1065+
10631066
return 0;
10641067
err_rt:
10651068
ip_rt_put(rt);
@@ -1135,6 +1138,9 @@ static int gtp_build_skb_ip6(struct sk_buff *skb, struct net_device *dev,
11351138
gtp_set_pktinfo_ipv6(pktinfo, pctx->sk, ip6h, pctx, rt, &fl6, dev);
11361139
gtp_push_header(skb, pktinfo);
11371140

1141+
netdev_dbg(dev, "gtp -> IP src: %pI6 dst: %pI6\n",
1142+
&ip6h->saddr, &ip6h->daddr);
1143+
11381144
return 0;
11391145
err_rt:
11401146
dst_release(dst);
@@ -1174,8 +1180,6 @@ static netdev_tx_t gtp_dev_xmit(struct sk_buff *skb, struct net_device *dev)
11741180

11751181
switch (proto) {
11761182
case ETH_P_IP:
1177-
netdev_dbg(pktinfo.dev, "gtp -> IP src: %pI4 dst: %pI4\n",
1178-
&pktinfo.iph->saddr, &pktinfo.iph->daddr);
11791183
udp_tunnel_xmit_skb(pktinfo.rt, pktinfo.sk, skb,
11801184
pktinfo.fl4.saddr, pktinfo.fl4.daddr,
11811185
pktinfo.iph->tos,
@@ -1188,8 +1192,6 @@ static netdev_tx_t gtp_dev_xmit(struct sk_buff *skb, struct net_device *dev)
11881192
break;
11891193
case ETH_P_IPV6:
11901194
#if IS_ENABLED(CONFIG_IPV6)
1191-
netdev_dbg(pktinfo.dev, "gtp -> IP src: %pI6 dst: %pI6\n",
1192-
&pktinfo.ip6h->saddr, &pktinfo.ip6h->daddr);
11931195
udp_tunnel6_xmit_skb(&pktinfo.rt6->dst, pktinfo.sk, skb, dev,
11941196
&pktinfo.fl6.saddr, &pktinfo.fl6.daddr,
11951197
ipv6_get_dsfield(pktinfo.ip6h),

0 commit comments

Comments
 (0)