Cleanup: Use common IP overhead definitions in test and prod code

This avoid duplication. As part of this moving the overhead calculation
to the IP address class so it's easier to find and more natural to use.

Bug: webrtc:9883
Change-Id: If4d865f445bc1a302572896932966ce30294e339
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169445
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30657}
diff --git a/rtc_base/async_packet_socket.cc b/rtc_base/async_packet_socket.cc
index a42725c..d5435d7 100644
--- a/rtc_base/async_packet_socket.cc
+++ b/rtc_base/async_packet_socket.cc
@@ -10,8 +10,6 @@
 
 #include "rtc_base/async_packet_socket.h"
 
-#include "rtc_base/net_helper.h"
-
 namespace rtc {
 
 PacketTimeUpdateParams::PacketTimeUpdateParams() = default;
@@ -35,12 +33,7 @@
                                        bool is_connectionless,
                                        rtc::PacketInfo* info) {
   info->packet_size_bytes = packet_size_bytes;
-  // TODO(srte): Make sure that the family of the local socket is always set
-  // in the VirtualSocket implementation and remove this check.
-  int family = socket_from.GetLocalAddress().family();
-  if (family != 0) {
-    info->ip_overhead_bytes = cricket::GetIpOverhead(family);
-  }
+  info->ip_overhead_bytes = socket_from.GetLocalAddress().ipaddr().overhead();
 }
 
 }  // namespace rtc