Skip to content

Commit 6bcd7d9

Browse files
committed
ip,ip6: remove the builtin ICMP echo API
The grcli ping and traceroute commands are gone, and nothing else ever called GR_IP4_ICMP_SEND, GR_IP4_ICMP_RECV or their IPv6 counterparts. What they drove goes with them: the session pool that held a reply until a client came to collect it, the two icmp_local_send nodes that built the echo requests, and the parsers that walked an error message looking for one of our own probes. The punt callback loses its session lookup and hands everything to the kernel. It keeps the drain check the pool used to do: a message that came in on an interface being removed is dropped rather than quietly delivered on the VRF loopback, which is where it would land once the addresses of that interface are gone. Deciding whether a message is well formed no longer happens here. The input nodes do it, so what reaches the callback has already been checked against RFC 792 and RFC 4443, and the errno the parsers used to carry is not needed to tell a malformed message from one that is simply not ours. icmp_output stays, icmp_input and ip_error both feed it, so grout still answers echo requests and still emits the time exceeded that traceroute walks through. Signed-off-by: Maxime Leroy <maxime@leroys.fr>
1 parent f559cfc commit 6bcd7d9

20 files changed

Lines changed: 424 additions & 1553 deletions

File tree

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,12 @@ graph Show packet processing graph info (requires interfaces to b
164164
interface Interfaces.
165165
logging Ingress/egress packet logging.
166166
nexthop Nexthops.
167-
ping Send ICMPv6 echo requests and wait for replies.
168167
quit Exit the CLI.
169168
route Routing tables.
170169
router-advert IPv6 router advertisements.
171170
snat44 Dynamic source NAT44.
172171
stats Packet processing statistics.
173172
trace Packet tracing.
174-
traceroute Discover IPv6 intermediate gateways.
175173
tunsrc SRv6 source address.
176174
grout# interface show
177175
NAME ID FLAGS MODE DOMAIN TYPE INFO
@@ -218,7 +216,6 @@ graph (Show packet processing graph info (requires interfaces to b
218216
interface (Interfaces.)
219217
logging (Ingress/egress packet logging.)
220218
nexthop (Nexthops.)
221-
ping (Send ICMPv6 echo requests and wait for replies.)
222219
quit (Exit the CLI.)
223220
route (Routing tables.)
224221
router-advert (IPv6 router advertisements.)
@@ -228,7 +225,6 @@ snat44 (Dynamic source NAT44.)
228225
stats (Packet processing statistics.)
229226
--trace-commands (Print executed commands.)
230227
trace (Packet tracing.)
231-
traceroute (Discover IPv6 intermediate gateways.)
232228
tunsrc (SRv6 source address.)
233229
-x (Print executed commands.)
234230
[root@grout]$ grcli stats <TAB><TAB>

api/gr_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <stdlib.h>
1212

1313
// Must be bumped when making non-backward compatible changes in API headers
14-
#define GR_API_VERSION 11
14+
#define GR_API_VERSION 12
1515

1616
// API request header.
1717
struct gr_api_request {

docs/graph.svg

Lines changed: 395 additions & 418 deletions
Loading

modules/infra/control/icmp_session.c

Lines changed: 0 additions & 243 deletions
This file was deleted.

modules/infra/control/icmp_session.h

Lines changed: 0 additions & 60 deletions
This file was deleted.

modules/infra/control/meson.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
src += files(
55
'bond.c',
66
'ctlplane.c',
7-
'icmp_session.c',
87
'graph.c',
98
'group_nexthop.c',
109
'iface.c',

modules/ip/api/gr_ip4.h

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ enum gr_ip4_requests : uint32_t {
3535
GR_IP4_ADDR_DEL,
3636
GR_IP4_ADDR_LIST,
3737
GR_IP4_ADDR_FLUSH,
38-
GR_IP4_ICMP_SEND,
39-
GR_IP4_ICMP_RECV,
4038
GR_IP4_FIB_DEFAULT_SET,
4139
GR_IP4_FIB_INFO_LIST,
4240
};
@@ -117,37 +115,6 @@ struct gr_ip4_addr_flush_req {
117115

118116
GR_REQ(GR_IP4_ADDR_FLUSH, struct gr_ip4_addr_flush_req, struct gr_empty);
119117

120-
// icmp ////////////////////////////////////////////////////////////////////////
121-
122-
// Send an ICMP echo request (ping).
123-
struct gr_ip4_icmp_send_req {
124-
ip4_addr_t addr;
125-
uint16_t vrf;
126-
uint16_t ident;
127-
uint16_t seq_num;
128-
uint8_t ttl;
129-
};
130-
131-
GR_REQ(GR_IP4_ICMP_SEND, struct gr_ip4_icmp_send_req, struct gr_empty);
132-
133-
// Receive an ICMP echo reply (ping response) or error.
134-
struct gr_ip4_icmp_recv_req {
135-
uint16_t ident;
136-
uint16_t seq_num;
137-
};
138-
139-
struct gr_ip4_icmp_recv_resp {
140-
uint8_t type;
141-
uint8_t code;
142-
uint8_t ttl;
143-
uint16_t ident;
144-
uint16_t seq_num;
145-
ip4_addr_t src_addr;
146-
gr_clock_ns_t response_time;
147-
};
148-
149-
GR_REQ(GR_IP4_ICMP_RECV, struct gr_ip4_icmp_recv_req, struct gr_ip4_icmp_recv_resp);
150-
151118
// fib info ////////////////////////////////////////////////////////////////////
152119

153120
// FIB status for a VRF.

0 commit comments

Comments
 (0)