Teaching a prober to speak GTP

A thirteen-line patch to an upstream tool was the whole substance of this image; the pipeline around it was the easy part.

DevOps

The wireless probe image is a two-stage Dockerfile. The second stage is upstream CloudProber, pinned (v0.13.7, no local changes). The first stage exists to compile one small C program and copy its binary across:

FROM alpine:latest AS build
RUN apk add musl-dev linux-headers git gcc make
COPY fix-ifs-with-no-addr.patch .
RUN git clone https://github.com/ThomasHabets/gtping.git \
    && cd gtping && git apply /fix-ifs-with-no-addr.patch \
    && ./configure && make && make install

FROM cloudprober/cloudprober:${CLOUDPROBER_VERSION}
LABEL GTP_PING_VERSION=gtping-0.15-master-patch
EXPOSE 9313
COPY --from=build /usr/local/bin/gtping /usr/local/bin/gtping

CloudProber already probes DNS, HTTP and ICMP. None of those says anything about a gateway's GTP-C path — a PGW can answer ICMP from its management interface while its control plane is deaf. A GTP echo request, and its matching echo response, is the only check that exercises what subscribers depend on. So the image carries gtping (0.15, one patch) and exposes 9313, so the probe's metrics are scraped like everything else in the estate.

The patch

gtping walks the host's interface list to pick a source address. In getIfAddrs() it read the address family straight off each entry:

- if (curifa->ifa_addr->sa_family != dest->ai_family) {
+ if (!curifa->ifa_addr || curifa->ifa_addr->sa_family != dest->ai_family) {

getifaddrs(3) may return an entry whose ifa_addr is NULL, and on these hosts it does: any interface with no address assigned produces one. The original line dereferences it, and the process dies before the first echo request leaves. That is the whole fix — one ||, kept as a patch file (13 lines, applied at build time) instead of a fork, so the upstream clone stays honest.

What the build migration broke

Jenkins built this repository for fifteen months from a two-line Jenkinsfile. In February 2026 it moved to a shared reusable workflow, and the replacement holds no build logic at all:

jobs:
  docker-image:
    uses: <org>/infra-ci-gha-workflows/.github/workflows/dockerImage.yml@latest
    secrets: inherit
    with:
      image_additional_tags: red

Same Dockerfile, different builder — and the build failed immediately. The new runner ships a newer GCC, which no longer tolerates clock_gettime() being called with no declaration in scope. So src/monotonic_generic.c would not compile. The fix landed the same day (commit two of four) as a second sed in the build stage:

&& sed -i '/#include"gtping.h"/a #include <time.h>' src/monotonic_generic.c

That is the part worth keeping about CI migrations of old C. The pipeline port is mechanical; the toolchain underneath it is not. An implicit declaration that a 2014 compiler warned about is a hard error on a 2026 one.

What it cost

Four commits across fifteen months (November 2024 to February 2026), and two lines of deployment metadata. Promotion to development fires on main and deploy-dev/* only; promotion to production became unconditional the day after the migration. An image that passed in development is promoted, not rebuilt — which matters, because a rebuilt image is a different image even from an identical Dockerfile (same source, different digest).